wiley
wiley_dist/src/etc/rc.d/init.d/wiley · 1.2 KB
From the archive WileyMUD3_091205.tar.bz2
Download the archive « Back to the archive contents
#!/bin/sh
#
# httpd This shell script takes care of starting and stopping
# httpd.
#
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
MUDDIR=/home/wiley
LOCKDIR=/var/lock/subsys
PIDDIR=/var/run
[ -f $MUDDIR/bin/wiley ] || exit 0
[ -f $MUDDIR/bin/wileymud ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting WileyMUD III: "
if [ "`pidofproc wiley`" = "" ]; then
echo -n "wiley "
$MUDDIR/bin/wiley &
fi
touch $LOCKDIR/wiley
echo
;;
stop)
# Stop daemons.
echo -n "Shutting down WileyMUD III: "
pid1=`pidofproc wileymud`
pid2=`pidofproc wiley`
if [ "$pid1" != "" ]; then
echo -n "wileymud "
kill -USR2 $pid1
sleep 5
kill -9 $pid1
rm -f $PIDDIR/wileymud.pid
fi
killproc wiley
echo "done"
rm -f $LOCKDIR/wiley
;;
*)
echo "Usage: wiley {start|stop}"
exit 1
esac
exit 0