Changed files:
wesnothd.init -> 1.5
# Get service config
[ -f /etc/sysconfig/wesnothd ] && . /etc/sysconfig/wesnothd
-RETVAL=0
-case "$1" in
- start)
+start() {
if [ ! -f /var/lock/subsys/wesnothd ]; then
msg_starting wesnothd
daemon "su - wesnothd -s /bin/sh -c '/usr/bin/wesnothd -p 14999 > /dev/null 2>&1 &'"
else
msg_already_running wesnothd
fi
- ;;
- stop)
+}
+
+stop() {
if [ -f /var/lock/subsys/wesnothd ]; then
msg_stopping wesnothd
killproc wesnothd
else
msg_not_running wesnothd
fi
+}
+
+RETVAL=0
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
;;
status)
status wesnothd
exit $?
;;
restart|force-reload)
- $0 stop
- $0 start
- exit $?
+ stop
+ start
;;
*)
msg_usage "$0 {start|stop|restart|force-reload|status}"