Klein, kompakt, übersichtlich und wirkungsvoll im Betrieb. Konfigurations-Bereich brauche ich nicht, da sich das eh nicht ändert und ich das Script ja eigentlich nicht für andere zur Verfügung stelle.
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 -d -m -S 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 -d -m -S 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 -d -m -S 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 -d -m -S 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
Startet / Stoppt CoD4 Server und ManuAdminMod.
Gibts auch in einer Extended Version, bei der beides zusammen oder einzeln gestartet werden kann, und wo auch der Debug genutzt werden kann.
Das is aber meins :rofl: