summaryrefslogtreecommitdiffstats
path: root/www/wyvern/files/wyvern.in
blob: 087b509496ca7c34995161711c5c92d8aa8a024c (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
44
45
46
47
48
49
#!/bin/sh
#
# $FreeBSD$
#

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

# Define these wyvern_* variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/wyvern
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
wyvern_enable=${wyvern_enable:-"NO"}	# Enable wyvern

. /etc/rc.subr

name="wyvern"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/wyvern"
pidfile="/var/run/wyvern.pid"
required_files="%%PREFIX%%/wyvern/conf/wyvern.conf"
start_cmd="wyvern_start"
stop_postcmd="wyvern_poststop"

wyvern_start() {
	${command} -r ${required_files}
}

wyvern_restart() {
	if [ -f ${pidfile} ]; then
		kill `cat ${pidfile}` > /dev/null 2>&1
		rm -f ${pidfile}
	fi
	${command} -r ${required_files}
}

wyvern_poststop() {
	if [ -f ${pidfile} ]; then
		rm -f ${pidfile}
	fi
}

load_rc_config $name
run_rc_command "$1"
OpenPOWER on IntegriCloud