SRCDS - autoreboot

Od HLDS.pl
Skocz do: nawigacji, wyszukiwania

UWAGA ten artykuł jest wyłącznie pod Linuksa

Skrypt do autoresetowania serwera, może sie nadac do demonizacji serwera gry na Linuxie.

Źródło http://www.cs-source.nl/index.php?name=News&file=article&sid=180


#!/bin/sh
#############################################
## SRCDS SERVER STARTUP SCRIPT V1.0        ##
## [10.10.2005]                            ##
## Created by:                             ##
## Ole Christian Rynning <oc@rynning.no>   ##
## jce #norge.css @ quakenet               ##
#############################################
 
#############################################
## CUSTOMIZE THESE VARIABLES TO YOUR NEEDS ## 
#############################################
 
###
# SCRDS_NAME is the name of the instance
# for example customer_css, clanwarserver,
# and so on.
# Default: css
SRCDS_NAME="css"
###
# SCRDS_BIN is the binary used to run the
# server, for srcds linux, it is commonly
# ''srcds_run''
#
# The reason it is prefixed by ./ is that
# the script by default changes dir to the
# SRCDS_PATH directory before running the
# binary
SRCDS_BIN="./srcds_run"
###
# SRCDS_PATH defines the physical location
# where srcds is installed; 
# for instance:
# ''/home/customer/srcds/''
SRCDS_PATH="."
###
# SRCDS_PIDFILE lets you specify a pidfile.
# if you want the pidfile in another location
# than the base dir of $SRCDS_PATH, you need
# to specify the full path;
# for instance:
# ''/home/customer/tmp/warserver.pid''
SRCDS_PIDFILE="${SRCDS_NAME}.pid"
###
# SRCDS_OPTS is all the default start options
# for the server that you cannot set in the
# server config files. Options such as tickrate, 
# ip, port and max_fps are set here
SRCDS_OPTS="-game cstrike -console \
    -autoupdate -pidfile ${SRDCS_PIDFILE} \
    -tickrate 100 +maxplayers 12 +map de_dust2 \
    -ip 217.78.96.31 -port 27015 +fps_max 600"
 
#############################################
##  DO NOT EDIT ANYTHING BELOW THIS LINE!  ##
#############################################
usage() {
    echo "Usage: ${SRCDS_NAME} (stop|start|restart)"
    exit 2
}
 
if [ -z $1 ]; then
    usage
fi
 
srcds_start() {
    OWD=`pwd`
    cd $SRCDS_PATH
    screen -AmdS ${SRCDS_NAME} ${SRCDS_BIN} ${SRCDS_OPTS}
    cd $OWD
}
 
srcds_stop() {
    screen -dr ${SRCDS_NAME} -X quit
}
 
srcds_restart() {
    srcds_stop
    srcds_start 
}
 
    
case $1 in
    stop)
        srcds_stop
    ;;
    start)
        srcds_start
    ;;
    restart)
        srcds_restart
    ;;
    *) 
        usage
esac
        
exit 0
Osobiste
Przestrzenie nazw
Warianty
Działania
HLDS.pl - Menu:
Inne
IRC
Inne sekcje:
Znajomi:
Narzędzia