[cod] Linux Startup scripts?

viper viper at totalerkrieg.com
Thu Dec 11 19:05:31 EST 2003


#! /bin/sh
#
# Soldier of Fortune 2 Server.
#
# AUTHORS :
#
# Oliver Dörfler ( Oliver.Doerfler at root4you.de )
#
# °dM{Ç!ðwN-=GER=-}To°
#
# Visit: www.Root4You.de and www.Divinus-Manus.de 
#
# ===========================================


#

clear
DIR=/home/cod
DAEMON=$DIR/cod_lnxded
# Internet-server:
PARAMS="+set dedicated 2 +exec default_mp.cfg +map_rotate"
NAME=codpublic
DESC="Call_of_Duty_Public_Server"

case "$1" in
 start)
   echo "Starting $DESC: $NAME"
   cd $DIR
   screen -A -m -d -S $NAME $DAEMON $PARAMS
   ;;

 stop)
   if [[ `screen -ls |grep $NAME` ]]
   then
       echo -n "Stopping $DESC: $NAME"
       kill `screen -ls |grep $NAME |awk -F . '{print $1}'|awk '{print
$1}'`
       echo " ... done."
   else
       echo "Coulnd't find a running $DESC"
   fi
   ;;

 restart)
   if [[ `screen -ls |grep $NAME` ]]
   then
       echo -n "Stopping $DESC: $NAME"
       kill `screen -ls |grep $NAME |awk -F . '{print $1}'|awk '{print
$1}'`
       echo " ... done."
   else
       echo "Coulnd't find a running $DESC"
   fi
   
   echo -n "Starting $DESC: $NAME"
   cd $DIR
   screen -d -m -S $NAME $DAEMON $PARAMS
   echo " ... done."
   ;;

 *)
   echo "Usage: $0 {start|stop|restart}"
   exit 1
   ;;
esac

exit 0






greetz

vIPER


Am Fre, 2003-12-12 um 00.43 schrieb MikeyDee:
> anyone have linux startup script ?
>  
> beside doing ./cod_lnxded
>  
> I was trying to add +set commands to get it automated but seem to fail
> on me?
>  




More information about the Cod mailing list