diff options
author | Danny Rawlins <romster@shortcircuit.net.au> | 2008-05-05 15:06:34 +1000 |
---|---|---|
committer | Danny Rawlins <romster@shortcircuit.net.au> | 2008-05-08 19:20:10 +1000 |
commit | 630426be7ecaa1cc6da236f64a209372d1a512ec (patch) | |
tree | e9f094f11596135a9d7b6ad44d4de3c24706186b /wesnoth-server/wesnothd.rc | |
parent | fc305ce9c9a261bbba844d06a432a503e27cd2b6 (diff) | |
download | contrib-630426be7ecaa1cc6da236f64a209372d1a512ec.tar.gz contrib-630426be7ecaa1cc6da236f64a209372d1a512ec.tar.xz |
wesnoth-server: initial commit
Diffstat (limited to 'wesnoth-server/wesnothd.rc')
-rw-r--r-- | wesnoth-server/wesnothd.rc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/wesnoth-server/wesnothd.rc b/wesnoth-server/wesnothd.rc new file mode 100644 index 000000000..b0609c954 --- /dev/null +++ b/wesnoth-server/wesnothd.rc @@ -0,0 +1,40 @@ +#!/bin/sh +# +# /etc/rc.d/wesnoth: start/stop wesnothd daemon +# + +# User settings here +DAEMON=wesnothd +RUN_AS_USER=_wesnoth + +RETVAL=0 + +case $1 in +start) + echo -n "Starting $DAEMON..." + su $RUN_AS_USER -c /usr/bin/$DAEMON > /dev/null & RETVAL=$? + if [ $RETVAL = 0 ]; then + echo " done." + fi + ;; +stop) + echo -n "Shutting down $DAEMON..." + killall -q /usr/bin/$DAEMON + RETVAL=$? + echo " done." + ;; +restart) + $0 stop + sleep 2 + $0 start + RETVAL=$? + ;; +*) + echo "usage: $0 [start|stop|restart]" + exit 1 + ;; +esac + +exit $RETVAL + +# End of file |