blob: b0609c954e449142a5ea6aa17a545f9dcb6bb259 (
plain)
1 #!/bin/sh
2 #
3 # /etc/rc.d/wesnoth: start/stop wesnothd daemon
4 #
5
6 # User settings here
7 DAEMON=wesnothd
8 RUN_AS_USER=_wesnoth
9
10 RETVAL=0
11
12 case $1 in
13 start)
14 echo -n "Starting $DAEMON..."
15 su $RUN_AS_USER -c /usr/bin/$DAEMON > /dev/null & RETVAL=$?
16 if [ $RETVAL = 0 ]; then
17 echo " done."
18 fi
19 ;;
20 stop)
21 echo -n "Shutting down $DAEMON..."
22 killall -q /usr/bin/$DAEMON
23 RETVAL=$?
24 echo " done."
25 ;;
26 restart)
27 $0 stop
28 sleep 2
29 $0 start
30 RETVAL=$?
31 ;;
32 *)
33 echo "usage: $0 [start|stop|restart]"
34 exit 1
35 ;;
36 esac
37
38 exit $RETVAL
39
40 # End of file
|