aboutsummaryrefslogtreecommitdiff
path: root/sysutils/geomWatch/files/geomWatch.in
blob: 58e93f4c76a448e232ea63276309adc5b12a065b (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
#!/bin/sh
# $FreeBSD

# PROVIDE: geomwatch
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

# Define these geomwatch_* variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/geomwatch
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
geomwatch_enable="${geomwatch_enable-NO}"
geomwatch_pidfile="/var/run/geomWatch.pid"

. /etc/rc.subr

name="geomwatch"
rcvar=geomwatch_enable
command="%%PREFIX%%/sbin/geomWatch"

load_rc_config $name

: ${geomwatch_config="%%PREFIX%%/etc/geomWatch.conf"}
: ${geomwatch_flags="-c ${geomwatch_config}"}

pidfile="${geomwatch_pidfile}"
required_files="${geomwatch_config}"

case "${geomwatch_flags}" in
*-p\ *)
	echo "ERROR: \$geomwatch_flags includes -p option." \
		"Please use \$geomwatch_pidfile instead."
	exit 1
	;;
*)
	geomwatch_flags="-p ${pidfile} ${geomwatch_flags}"
	;;
esac

run_rc_command "$1"