summaryrefslogtreecommitdiff
path: root/wesnoth-server/wesnothd.rc
diff options
context:
space:
mode:
authorDanny Rawlins <romster@shortcircuit.net.au>2008-05-05 15:06:34 +1000
committerDanny Rawlins <romster@shortcircuit.net.au>2008-05-08 19:20:10 +1000
commit630426be7ecaa1cc6da236f64a209372d1a512ec (patch)
treee9f094f11596135a9d7b6ad44d4de3c24706186b /wesnoth-server/wesnothd.rc
parentfc305ce9c9a261bbba844d06a432a503e27cd2b6 (diff)
downloadcontrib-630426be7ecaa1cc6da236f64a209372d1a512ec.tar.gz
contrib-630426be7ecaa1cc6da236f64a209372d1a512ec.tar.xz
wesnoth-server: initial commit
Diffstat (limited to 'wesnoth-server/wesnothd.rc')
-rw-r--r--wesnoth-server/wesnothd.rc40
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

Generated by cgit