blob: 33bb21bb07451c4b51b588ae365b863b3991f352 (
plain) (
blame)
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
44
45
46
47
48
49
50
51
52
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: upclient
# REQUIRE: DAEMON
# KEYWORD: FreeBSD
#
# Add the following line to /etc/rc.conf to enable upclient:
#
# upclient_enable="YES"
#
upclient_precmd ()
{
ws=" "
grep -qs "^[$ws]*AuthKey[$ws]*=" ${configfile} ||
err 1 "AuthKey is missing from ${configfile}."
grep -qs "^[$ws]*AuthKey[$ws]*=[$ws]*your_authkey" ${configfile} &&
err 1 "AuthKey isn't configured in ${configfile}."
hn=uptimes.wonko.com
egrep -qs "^[$ws]*UptimeServer[$ws]*=[$ws]*${hn}[$ws]*" ${configfile} &&
err 1 "${configfile} needs to be updated from ${samplefile}."
kw="IdleTime|OS|(OS|CPU)Level"
egrep -qs "^[$ws]*Send($kw)[$ws]*=" ${configfile} &&
err 1 "${configfile} needs to be updated from ${samplefile}."
:
}
upclient_enable=NO
upclient_flags=
. %%RC_SUBR%%
name=upclient
rcvar=$(set_rcvar)
# private
configfile=%%PREFIX%%/etc/${name}.conf
samplefile=${configfile}.sample
# public
command=%%PREFIX%%/sbin/${name}
pidfile=/var/run/${name}.pid
required_files=${configfile}
start_precmd=${name}_precmd
load_rc_config ${name}
run_rc_command "$1"
|