aboutsummaryrefslogtreecommitdiff
path: root/games/sampsvr/files/sampd.in
blob: 75f6fc5fe54cb4fac43486db95ed664d1a931459 (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
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: sampd
# REQUIRE: NETWORKING
#
# Add the following line to /etc/rc.conf[.local] to enable sampd
#
# sampd_enable (bool):		Set to "NO" by default.
#                               Set it to "YES" to enable sampd.

. %%RC_SUBR%%

name="sampd"
rcvar=${name}_enable

load_rc_config $name

: ${sampd_enable="NO"}
: ${sampd_chdir="%%SAMPDIR%%"}

command="%%SAMPDIR%%/%%SAMPBIN%%"
command_args="> /dev/null &"
required_files="%%PREFIX%%/etc/sampsvr.cfg"
start_precmd="sampd_prestart"
stop_precmd="sampd_prestop"

sampd_prestart() {
    if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then
	err 1 "Linux support required"
    fi
}
		
sampd_prestop() {
    rc_pid=`echo $rc_pid | awk '{print $1}'`
}
		    
run_rc_command "$1"