2014-03-15 16:59:03 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
#
|
|
|
|
# SRB2 MasterServer - start up the masterserver
|
|
|
|
#
|
|
|
|
|
|
|
|
# Get LSB functions
|
|
|
|
. /lib/lsb/init-functions
|
2020-03-20 14:12:19 +00:00
|
|
|
#. /etc/default/rcS
|
2014-03-15 16:59:03 +00:00
|
|
|
|
2020-03-20 14:12:19 +00:00
|
|
|
#SRB2MS=/usr/local/bin/masterserver
|
|
|
|
SRB2MS=./server
|
2014-03-15 16:59:03 +00:00
|
|
|
SRB2MS_PORT=28900
|
|
|
|
|
|
|
|
# Check that the package is still installed
|
|
|
|
[ -x $SRB2MS ] || exit 0;
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2020-03-20 14:12:19 +00:00
|
|
|
log_begin_msg "Starting SRB2MS...\n"
|
2014-03-15 16:59:03 +00:00
|
|
|
umask 002
|
2020-03-20 14:12:19 +00:00
|
|
|
if exec $SRB2MS $SRB2MS_PORT & then
|
2014-03-15 16:59:03 +00:00
|
|
|
log_end_msg 0
|
|
|
|
else
|
|
|
|
log_end_msg $?
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
stop)
|
2020-03-20 14:12:19 +00:00
|
|
|
log_begin_msg "Stopping SRB2MS...\n"
|
|
|
|
if killall $SRB2MS -q & then
|
|
|
|
log_end_msg 0
|
2014-03-15 16:59:03 +00:00
|
|
|
else
|
2020-03-20 14:12:19 +00:00
|
|
|
log_end_msg $?
|
2014-03-15 16:59:03 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
restart|force-reload)
|
|
|
|
"$0" stop && "$0" start
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2020-03-20 14:12:19 +00:00
|
|
|
echo "Usage: $0 {start|stop|restart|force-reload}"
|
2014-03-15 16:59:03 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|