13.09.2013, 13:57
Hello.. I wasted some of my time learning about linux scripts (or whatever it calls)
I have my auto restarter script right here (i mean when server crashes or something, that script automatically turns server online or restarts server by marked time). but when i trying to start that script with putty, i get some errors..
Can someone explain me that? (btw i chmoded script already)
errors after trying to run script:
ATTENTION: Should i put script in my server directory?
I have my auto restarter script right here (i mean when server crashes or something, that script automatically turns server online or restarts server by marked time). but when i trying to start that script with putty, i get some errors..
Can someone explain me that? (btw i chmoded script already)
Код:
restart.sh #!/bin/sh log=samp.log dat=`date` samp="/root/samp03" cd /root/samp03 echo "${dat} watchdog script starting." >>${log} while true; do echo "${dat} Server exited, restarting..." >>${log} mv /root/samp03/server_log.txt /root/samp03/server_log.`date '+%m%d%y%H%M%S'` ${samp} >> $log sleep 2 done
Код:
/root/samp03/restart.sh: line 13: syntax error near unexpected token `done' /root/samp03/restart.sh: line 13: `done'