2002-10-31 23:56:24 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
|
|
|
|
# cyphesis This shell script takes care of starting and stopping
|
|
|
|
|
# the cyphesis service.
|
|
|
|
|
#
|
|
|
|
|
# chkconfig: - 99 01
|
|
|
|
|
# description: Cyphesis is a server for WorldForge online games.
|
|
|
|
|
# probe: ???
|
|
|
|
|
|
|
|
|
|
if [ -f /etc/rc.d/init.d/functions ] ; then
|
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Source cyphesis service configuration
|
|
|
|
|
if [ -f /etc/sysconfig/cyphesis ] ; then
|
|
|
|
|
. /etc/sysconfig/cyphesis
|
|
|
|
|
else
|
|
|
|
|
CYPHESISUSER=cyphesis
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
start() {
|
|
|
|
|
# Run the client
|
|
|
|
|
|
|
|
|
|
# /var/lock/subsys/cyphesis
|
|
|
|
|
echo -n $"Populating cyphesis world: "
|
|
|
|
|
|
|
|
|
|
# Run the server, in self daemonising mode
|
2005-01-05 02:13:13 +00:00
|
|
|
su $CYPHESISUSER -c "/usr/bin/cyclient" >/dev/null 2>&1
|
2002-10-31 23:56:24 +00:00
|
|
|
RETVAL=$?
|
|
|
|
|
if [ $RETVAL -eq 0 ]; then
|
|
|
|
|
echo_success
|
|
|
|
|
else
|
|
|
|
|
echo_failure
|
|
|
|
|
fi
|
|
|
|
|
echo
|
|
|
|
|
return $RETVAL
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
|
start)
|
|
|
|
|
start
|
|
|
|
|
;;
|
|
|
|
|
stop)
|
|
|
|
|
stop
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo $"Usage: $0 (start|stop)"
|
|
|
|
|
exit 1
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
exit $RETVAL
|