PDA

View Full Version : Ts Restart Script


Mr.Pink
01-06-2006, 13:38
HI ich hab nscript fürn ts aber funtzt ned kann mir einer sagen wieso bzw hat n anderen vorschlag ?

so des is mein code

! /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/flesh/teamspeak/tss2_rc2"

### 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




so und des is der crontab

*/5 * * * * /home/flesh/teamspeak/tss2_rc2/tschk.sh >/dev/null 2>&1


funtzt aba ned weis einer wieso ?