3
# steam This shell script takes care of starting and stopping
7
# description: sTeam server.
9
# config: /usr//share/steam/config/steam.cnf
10
# pidfile: /var/run/steam.pid
12
# Source function library.
13
. /etc/rc.d/init.d/functions
15
# Source networking configuration.
16
. /etc/sysconfig/network
20
pidfile="/var/run/steam.pid"
21
steamhome="/usr//share/steam"
26
cd $steamhome && ./start --pid="$pidfile" &> $steamhome/logs/init.d_start.log &
27
# Give server 10 seconds to start:
28
for x in 1 2 3 4 5 6 7 8 9 10; do
29
if [ -e "$pidfile" ]; then
35
if [ -e "$pidfile" ]; then
36
action $"Starting $prog: " /bin/true
37
touch /var/lock/subsys/$prog
40
action $"Starting $prog: " /bin/false
47
cd $steamhome && ./stop --pid="$pidfile" &> $steamhome/logs/init.d_stop.log
48
#kill `cat $pidfile` &> $steamhome/logs/init.d_stop.log
50
if [ $ret -eq 0 ]; then
51
action $"Stopping $prog: " /bin/true
53
action $"Stopping $prog: " /bin/false
55
[ $ret -eq 0 ] && rm -f /var/lock/subsys/$prog
66
[ -e /var/lock/subsys/$prog ] && restart || :
69
# See how we were called.
87
echo $"Usage: $0 {start|stop|status|condrestart|restart}"