diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2006-12-02 00:32:11 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2006-12-02 00:32:11 +0000 |
commit | 620cb3cae5559e875bdb0541bf8233238aa9cd84 (patch) | |
tree | 9d62ea9356f36169b11e0a70660f9a7da398f155 /games/sampsvr/files/sampd.in | |
parent | 918ed17c0cabce1bf1735da86bf5a04b1f53e799 (diff) |
Notes
Diffstat (limited to 'games/sampsvr/files/sampd.in')
-rw-r--r-- | games/sampsvr/files/sampd.in | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/games/sampsvr/files/sampd.in b/games/sampsvr/files/sampd.in new file mode 100644 index 000000000000..f494fbc2d26c --- /dev/null +++ b/games/sampsvr/files/sampd.in @@ -0,0 +1,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%%/sampd" +command_args="&" +required_files="%%SAMPDIR%%/server.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" |