Results 1 to 10 of 24

Thread: [CoD2/CoD4] Server auto-restart

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12
    ... connecting
    Join Date
    Jan 2013
    Posts
    7
    Thanks
    0
    Thanked 8 Times in 3 Posts
    file: cod2_lnxded_autoBoot
    Code:
    #!/bin/bash
    #
    # call of duty 2 auto restart script.
    # including a logfile relocater
    #
    # pluginLoader
    export LD_PRELOAD="/usr/lib/cod2/libcod2_1_2.so"
    #
    # Settings:
    cd "/home/games/cod2/server/"
    MOD="tdm"
    CONSOLE_FILE="console_mp_server.log"
    SCREEN_FILE="screenlog.0"
    OUTPUT_DIR=".console/"
    #
    # DO NOT EDIT BELOW
    CONSOLE_FILE_PATH=".callofduty2/$MOD/$CONSOLE_FILE"
    CONSOLE_FILE_PATH_DST=$OUTPUT_DIR$CONSOLE_FILE
    SCREEN_FILE_PATH_DST=$OUTPUT_DIR$SCREEN_FILE
    TMP_OUTPUT_FILE="autoboot.log"
    
    if [ ! -d $OUTPUT_DIR ]; then
    	mkdir -p $OUTPUT_DIR
    fi
    #
    #
    for count in {1..10} ; do
    	"./cod2_lnxded" "$@"
    	if [ -f $TMP_OUTPUT_FILE ]; then
    		rm $TMP_OUTPUT_FILE
    	fi
    	if [ -f $CONSOLE_FILE_PATH ]; then
    		mv $CONSOLE_FILE_PATH "$CONSOLE_FILE_PATH_DST$count"
    		echo "moved $CONSOLE_FILE_PATH to $CONSOLE_FILE_PATH_DST$count"
    	fi
    	if [ -f $SCREEN_FILE ]; then
    		tail -n 2000 $SCREEN_FILE > "$SCREEN_FILE_PATH_DST$count"
    		echo "copied last 2k lines from $SCREEN_FILE to $SCREEN_FILE_PATH_DST$count"
    	fi	
    	echo "Times Crached:" $count >> autoboot.log
    	echo "Restarting the server..."
    	sleep 5;
    done
    exit 1
    ./cod2_lnxded_autoBoot +set dedicated 2 +map mp_toujane
    (Your startupline for normal cod2)

  2. The Following 2 Users Say Thank You to Selbie For This Useful Post:

    kung foo man (18th December 2015),maxdamage99 (18th December 2015)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •