Anyone can help me here?
#1

Код:
#!/bin/bash
function startServer(){
NUMSECONDS=`expr $(date +%s)`
until ./samp03svr  ; do
let DIFF=(`date +%s` - "$NUMSECONDS")
if [ "$DIFF" -gt 15 ]; then
NUMSECONDS=`expr $(date +%s)`
echo "Server './samp03svr  ' crashed with exit code $?.  Respawning..." >&2 
fi
sleep 3
done
let DIFF=(`date +%s` - "$NUMSECONDS")
if [ ! -e "SERVER_STOPPED" ] && [ "$DIFF" -gt 15 ]; then
startServer
fi
}
startServer
Reply


Messages In This Thread
Anyone can help me here? - by PrinceKumar - 17.11.2016, 08:15
Re: Anyone can help me here? - by PrinceKumar - 17.11.2016, 08:19
Re: Anyone can help me here? - by PrinceKumar - 17.11.2016, 12:21
Re: Anyone can help me here? - by SyS - 17.11.2016, 12:23
Re: Anyone can help me here? - by PrinceKumar - 17.11.2016, 12:28

Forum Jump:


Users browsing this thread: 2 Guest(s)