[LINUX] .sh - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [LINUX] .sh (
/showthread.php?tid=463690)
[LINUX] .sh -
ixesas - 13.09.2013
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)
Код:
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
errors after trying to run script:
Код:
/root/samp03/restart.sh: line 13: syntax error near unexpected token `done'
/root/samp03/restart.sh: line 13: `done'
ATTENTION: Should i put script in my server directory?
Re: [LINUX] .sh -
Tamer - 13.09.2013
Ofcourse its supposed to be near samp03xsvr
Re: [LINUX] .sh -
ixesas - 13.09.2013
Okay, than why did i get error with "done"?
Re: [LINUX] .sh -
ixesas - 13.09.2013
FIXED
Re: [LINUX] .sh -
xFuTuRe - 18.03.2014
Experiencing same problem, how can I fix this?