davidlig
13/01/2010, 03:04
#!/bin/sh # This is the crontab script for ts2. # # Please change the following path to your ts2-directory. TS2PATH=/route/to/ts2 # the rest should be kept as is if test -r $TS2PATH/tsserver2.pid; then TS2PID=$(cat $TS2PATH/tsserver2.pid) if $(kill -CHLD $TS2PID >/dev/null 2>&1) then exit 0 fi fi cd $TS2PATH ./teamspeak2-server_startscript start
if test -r $TS2PATH/tsserver2.pid; then TS2PID=$(cat $TS2PATH/tsserver2.pid)
MAILTO=direccion@email.com # m h dom mon dow command 0,30 * * * * /route/to/ts2/filename
#! /bin/sh # # TeamSpeak Cron Job # Author: Chris Childers # E-Mail: Chris@darkstarllc.com # Address: http://www.darkstarllc.com # ### Set your default TS Root Directory tsdir="/home/servidorts/teamspeak" ### Set your TS Binary Name tsbin="server_linux" ### Set your TS Pid File tspid="tsserver2.pid" ########## you probably don't need to change anything below here ########## cd $tsdir # is there a pid file? if test -r $tspid then # there is a pid file -- is it current? pid=`cat $tspid` if `kill -CHLD $pid >/dev/null 2>&1` then echo "TeamSpeak is currently running...." exit 0 fi echo "" echo "Stale $tspid file, erasing..." echo "Attempting to Restart TeamSpeak" rm -f $tspid ./$tsbin -PID=$tspid & else echo "$tspid appears to be missing. Attempting to Restart TeamSpeak" ./$tsbin -PID=$tspid fi