]> git.pld-linux.org Git - packages/wesnoth.git/blob - wesnothd.init
- wesnothd works now
[packages/wesnoth.git] / wesnothd.init
1 #!/bin/sh
2 #
3 # chkconfig:    345 90 12
4 # description:  wesnothd games server
5 #
6 # wesnothd      wesnothd server
7
8 # Source function library
9 . /etc/rc.d/init.d/functions
10
11 # Get service config
12 [ -f /etc/sysconfig/wesnothd ] && . /etc/sysconfig/wesnothd
13
14 RETVAL=0
15 case "$1" in
16   start)
17         if [ ! -f /var/lock/subsys/wesnothd ]; then
18                 msg_starting wesnothd
19                 daemon "su - wesnothd -s /bin/sh -c '/usr/bin/wesnothd -p 14999 > /dev/null 2>&1 &'"
20                 RETVAL=$?
21                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/wesnothd
22         else
23                 msg_already_running wesnothd
24         fi
25         ;;
26   stop)
27         if [ -f /var/lock/subsys/wesnothd ]; then
28                 msg_stopping wesnothd
29                 killproc wesnothd
30                 rm /var/lock/subsys/wesnothd
31         else
32                 msg_not_running wesnothd
33         fi
34         ;;
35   status)
36         status wesnothd
37         exit $?
38         ;;
39   restart|force-reload)
40         $0 stop
41         $0 start
42         exit $?
43         ;;
44   *)
45         msg_usage "$0 {start|stop|restart|force-reload|status}"
46         exit 3
47 esac
48
49 exit $RETVAL
This page took 0.22264 seconds and 4 git commands to generate.