updated on Tue Jan 17 12:00:36 UTC 2012
[aur-mirror.git] / bin32-iowolfet-hg / iowolfet-ded.rc
blob5c924483bcc5f5b0f828a47313ba6337f77292ed
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 ET_BIN=/opt/iowolfet/ioetded.i386
7 PID=`pidof -o %PPID $ET_BIN`
9 case "$1" in
10 start)
11 stat_busy "Starting Enemy Territory Dedicated Server"
12 [ -z "$PID" ] && `su games -c "/usr/bin/iowolfet-ded &> /dev/null &"`
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon etded
17 stat_done
20 stop)
21 stat_busy "Stopping Enemy Territory Dedicated Server"
22 [ ! -z "$PID" ] && kill $PID &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon etded
27 stat_done
30 restart)
31 $0 stop
32 sleep 2
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac