start-stop-daemon: group `ame' not found
Кажеться дело в том что он строку comands="./hlds_run -game
воспринимает как продолжение команды.
Код: Выделить всё
#!/bin/bash
PIDFILE="/home/gamer/hlds_classic/cs.pid"
comands="./hlds_run -game cstrike -nomaster +map cs_assault +port 27015 -maxplayers 24 +mp_freezetime 3 +exec server.cfg -pingboost 1 +sys_ticrate 10000 +sv_maxupdaterate 100"
RETVAL=0
path="/home/gamer/hlds_classic"
start() {
if [ -d $path ]; then
cd $path
start-stop-daemon --start --background --make-pidfile --pidfile ${PIDFILE} --chuid gamer -a ${comands}
touch ./cstrike.run
fi
}
stop() {
if [ -f $path/cstrike.run ]; then
start-stop-daemon --stop --quiet --exec ${comands}
cd $path
rm -R ./cstrike.run
fi
}
case "$1" in
start)
start
echo "CS Server-1 starting"
;;
stop)
stop
echo "CS Server-1 stoping"
;;
restart)
echo "Restarting CS-server"
stop
sleep 2
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $RETVAL