summaryrefslogtreecommitdiff
path: root/sysutils/pies/files/pies.in
blob: 3ae360c7ed7ec495391aaeb59e0928bc5ecc74ba (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
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: pies
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
#

. /etc/rc.subr

name="pies"
rcvar=pies_enable
command="%%PREFIX%%/sbin/${name}"
ctlcommand="%%PREFIX%%/bin/${name}ctl"
pidfile="/var/run/${name}/${name}.pid"

: ${pies_enable="NO"}

start_cmd="${name}_start"
reload_cmd="${name}_reload"
restart_cmd="${name}_restart"
status_cmd="${name}_status"
stop_cmd="${name}_stop"
configtest_cmd="${name}_configtest"

extra_commands="reload configtest"

pies_start()
{
	${command}
}

pies_reload()
{
	${ctlcommand} -v config reload
}

pies_restart()
{
	${ctlcommand} reboot
}

pies_status()
{
	${ctlcommand} -v list
}

pies_stop()
{
	${ctlcommand} shutdown
}

pies_configtest()
{
	${command} --lint
}

load_rc_config ${name}
run_rc_command "$1"