21.10.2009, 00:57
Hey there, I've been trying to help a mate created a server restarter script, but as I have no experience with linux I have no idea why it isn't working.
This is what we have:
And i placed this script into my servers directory, And when i try to run the script this is the outcome:
This is what we have:
Код:
#!/bin/sh log=samp.log dat=`date` samp="/home/SA-MP/MyServer/samp03/samp03svr" cd /home/SA-MP/MyServer/samp03 echo "${dat} watchdog script starting." >>${log} while true; do echo "${dat} Server exited, restarting..." >>${log} mv /home/SA-MP/MyServer/samp03/server_log.txt /home/SA-MP/MyServer/samp03/logs/server_log.`date '+%m%d%y%H%M%S'` ${samp} >> $log sleep 2 done
Код:
> cd /home/SA-MP/MyServer/samp03 > nohup ./restart.sh & nohup: cannot run command `./restart.sh': No such file or directory