#! /bin/sh # # wesnothd Wesnoth server # # chkconfig: 345 98 02 # # description: This is a 'Battle for Wesnoth' daemon # # Modified for ALTLinux # by Gleb Stiblo # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # Do not load RH compatibility interface. WITHOUT_RC_COMPAT=1 # Source function library . /etc/rc.d/init.d/functions DAEMON=/usr/games/wesnothd NAME=wesnothd LOCKFILE=/var/lock/subsys/wesnothd PIDFILE=/var/run/wesnothd.pid RETVAL=0 test -x $DAEMON || exit 0 # Include wesnoth defaults if available #if [ -f /etc/default/wesnoth ] ; then # . /etc/default/wesnoth #fi #set -e start() { start_daemon --make-pidfile $PIDFILE --pidfile $PIDFILE --name $NAME -- $DAEMON RETVAL=$? return $RETVAL } stop() { stop_daemon --pidfile $PIDFILE --name $NAME -- $DAEMON RETVAL=$? return $RETVAL } restart() { stop sleep 1 start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) ;; condrestart) if [ -e "$LOCKFILE" ]; then restart fi ;; condreload) ;; status) status --pidfile "$PIDFILE" -- $DAEMON RETVAL=$? ;; *) msg_usage "${0##*/} {start|stop|restart|reload|condrestart|condreload|status}" RETVAL=1 esac exit $RETVAL