blob: b9469acf00203524c48aa7740dd1b86029b65f57 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#!/bin/sh
# PROVIDE: tuptime
# REQUIRE: DAEMON
# KEYWORD: nojail shutdown
. /etc/rc.subr
name="tuptime"
rcvar=tuptime_enable
tuptime_user="tuptime"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
export PATH=$PATH:/usr/local/bin/
tuptime_start()
{
echo "Starting $name."
command_args="-x"
if /usr/sbin/pw usershow "${tuptime_user}" >/dev/null 2>&1; then
su -m ${tuptime_user} -c "$name $command_args"
else
$name $command_args
fi
}
tuptime_stop()
{
echo "Stopping $name."
command_args="-xg"
if /usr/sbin/pw usershow "${tuptime_user}" >/dev/null 2>&1; then
su -m ${tuptime_user} -c "$name $command_args"
else
$name $command_args
fi
}
load_rc_config $name
run_rc_command "$1"
|