Skip to content

Instantly share code, notes, and snippets.

@ramnes
Created February 16, 2015 14:59
Show Gist options
  • Save ramnes/df3eb1b35e98c434f249 to your computer and use it in GitHub Desktop.
Save ramnes/df3eb1b35e98c434f249 to your computer and use it in GitHub Desktop.
#!/bin/sh
DAEMON="/home/et/etded"
DAEMON_OPT="+set net_port 27960 +set fs_game etpro +exec server"
DAEMON_USER="et"
DAEMON_NAME="etded.x86"
DAEMON_DESC="Wolfenstein Enemy Territory server"
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
echo "Starting $DAEMON_DESC"
start-stop-daemon --start --chuid $DAEMON_USER --name $DAEMON_NAME --background --exec $DAEMON -- $DAEMON_OPT
;;
stop)
echo "Stopping $DAEMON_DESC"
start-stop-daemon --stop --name $DAEMON_NAME
;;
restart)
start-stop-daemon --stop --name $DAEMON_NAME
start-stop-daemon --start --chuid $DAEMON_USER --group $DAEMON_USER --name $DAEMON_NAME --background --exec $DAEMON -- $DAEMON_OPT
;;
force-stop)
pkill -f $DAEMON_NAME
;;
status)
status_of_proc "$DAEMON_NAME" "$DAEMON"
;;
*)
echo "Usage: /etc/init.d/$DAEMON_NAME {start|stop|force-stop|restart|status}"
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment