- Offizieller Beitrag
ZitatAlles anzeigen#!/bin/sh
case "$1" in
start)
echo "========================================"
cd /home/cod4/
echo "Call of Duty 4 Server is starting now."sleep 1
echo "----------------------------------------"
sleep 1echo "The Call of Duty 4 Server is starting."
screen -dmS cod /home/cod4/cod4_lnxded +exec server.cfg +set fs_homepath /home/cod4/ +set sv_punkbuster 1 +set sv_pure 1 +map_rotate
echo ">>> Starting Call of Duty 4 Server done."sleep 5
echo "----------------------------------------"
cd /home/cod4/mods/mam/
sleep 5echo "The ManuAdminMod (Plugin) is starting."
screen -dmS mam /usr/bin/php -f daemon.php config logfiles
echo ">>> Starting ManuAdminMod (Plugin) done."echo "----------------------------------------"
echo "Call of Duty 4 Server was started now."
echo "========================================"
;;stop)
if [[ `screen -ls |grep cod` ]]
then
echo "========================================"
cd /home/cod4/
echo "Call of Duty 4 Server is stopping now."sleep 1
echo "----------------------------------------"
sleep 1echo "The Call of Duty 4 Server is stopping."
kill `screen -ls |grep cod |awk -F . '{print $1}'|awk '{print $1}'`
echo ">>> Stopping Call of Duty 4 Server done."sleep 5
echo "----------------------------------------"
cd /home/cod4/mods/mam/
sleep 5echo "The ManuAdminMod (Plugin) is stopping."
kill `screen -ls |grep mam |awk -F . '{print $1}'|awk '{print $1}'`
echo ">>> Stopping ManuAdminMod (Plugin) done."echo "----------------------------------------"
echo "Call of Duty 4 Server was stopped now."
echo "========================================"else
echo "========================================"
echo "The Call of Duty 4 Server is not running."
echo "========================================"
fi
;;restart)
if [[ `screen -ls |grep cod` ]]
then
echo "========================================"
cd /home/cod4/
echo "Call of Duty 4 Server is stopping now."sleep 1
echo "----------------------------------------"
sleep 1echo "The Call of Duty 4 Server is stopping."
kill `screen -ls |grep cod |awk -F . '{print $1}'|awk '{print $1}'`
echo ">>> Stopping Call of Duty 4 Server done."sleep 5
echo "----------------------------------------"
cd /home/cod4/mods/mam/
sleep 5echo "The ManuAdminMod (Plugin) is stopping."
kill `screen -ls |grep mam |awk -F . '{print $1}'|awk '{print $1}'`
echo ">>> Stopping ManuAdminMod (Plugin) done."echo "----------------------------------------"
echo "Call of Duty 4 Server was stopped now."
echo "========================================"
echo " "else
echo "========================================"
echo "The Call of Duty 4 Server is not running."
echo "========================================"
echo " "
fiecho "========================================"
cd /home/cod4/
echo "Call of Duty 4 Server is starting now."sleep 1
echo "----------------------------------------"
sleep 1echo "The Call of Duty 4 Server is starting."
screen -dmS cod /home/cod4/cod4_lnxded +exec server.cfg +set fs_homepath /home/cod4/ +set sv_punkbuster 1 +set sv_pure 1 +map_rotate
echo ">>> Starting Call of Duty 4 Server done."sleep 5
echo "----------------------------------------"
cd /home/cod4/mods/mam/
sleep 5echo "The ManuAdminMod (Plugin) is starting."
screen -dmS mam /usr/bin/php -f daemon.php config logfiles
echo ">>> Starting ManuAdminMod (Plugin) done."echo "----------------------------------------"
echo "Call of Duty 4 Server was started now."
echo "========================================"
;;*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
Das ist mein Startscript.
Es gibt ein kleines Problem beim stoppen,
denn das Script zeigt mir an, das der Server nicht läuft obwohl er das tut.
Vor einigen Tagen gings noch, und ich habe nichts am Script geändert.
So lauten die beiden Prozesse, eigentlich müsste er die doch erkennen.
Zitat
13352 ? Ss 0:00 SCREEN -dmS cod /home/cod4/cod4_lnxded +exec server.c
13354 pts/1 Ss+ 3:22 ./cod4_lnxded-bin +exec server.cfg +set fs_homepath /
13378 ? Ss 0:00 SCREEN -dmS mam /usr/bin/php -f daemon.php config log
13379 pts/2 Ss+ 0:00 /usr/bin/php -f daemon.php config logfiles