diff options
author | Marcus Alves Grando <mnag@FreeBSD.org> | 2006-04-14 18:10:37 +0000 |
---|---|---|
committer | Marcus Alves Grando <mnag@FreeBSD.org> | 2006-04-14 18:10:37 +0000 |
commit | 8bdc9bfcf51fcc37a544dcbdd45605db69c6c675 (patch) | |
tree | 9d70484f452214f07d2eebe515a64e5a0c78788c /audio/teamspeak_server/files | |
parent | f663d9082e0e73d7057424d34ae8425054158142 (diff) | |
download | ports-8bdc9bfcf51fcc37a544dcbdd45605db69c6c675.tar.gz ports-8bdc9bfcf51fcc37a544dcbdd45605db69c6c675.zip |
Notes
Diffstat (limited to 'audio/teamspeak_server/files')
-rw-r--r-- | audio/teamspeak_server/files/teamspeak-server.in | 35 | ||||
-rw-r--r-- | audio/teamspeak_server/files/teamspeak_server.sh | 29 |
2 files changed, 35 insertions, 29 deletions
diff --git a/audio/teamspeak_server/files/teamspeak-server.in b/audio/teamspeak_server/files/teamspeak-server.in new file mode 100644 index 000000000000..eae1f09842a0 --- /dev/null +++ b/audio/teamspeak_server/files/teamspeak-server.in @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: teamspeak +# REQUIRE: NETWORKING +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# teamspeak_enable (bool): Set to NO by default. +# Set it to YES to enable teamspeak. +# + +. %%RC_SUBR%% + +name=teamspeak +rcvar=${name}_enable + +command="%%PREFIX%%/lib/teamspeak_server/server_linux" +command_args=">/dev/null" +pidfile="%%PREFIX%%/lib/teamspeak_server/server.pid" +stop_postcmd="teamspeak_poststop" + +teamspeak_poststop() +{ + /bin/rm -f "${pidfile}" +} + +load_rc_config $name + +: ${teamspeak_enable="NO"} + +run_rc_command "$1" diff --git a/audio/teamspeak_server/files/teamspeak_server.sh b/audio/teamspeak_server/files/teamspeak_server.sh deleted file mode 100644 index be5137cbfcc1..000000000000 --- a/audio/teamspeak_server/files/teamspeak_server.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Start/stop the TeamSpeak 2 server -# - -TSHOME=%%TSHOME%% -PIDFILE=${TSHOME}/server.pid - -cd "$TSHOME" - -case "$1" in - start) - su -fm teamspeak -c './server_linux >/dev/null' && echo -n ' teamspeak_server' - ;; - stop) - kill -TERM `cat "$PIDFILE"` - ;; - restart) - $0 stop - echo 5 second pause before restart. . . - sleep 5 - $0 start - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 -esac -exit 0 - |