[LINUX] .sh
#1

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?
Reply
#2

Ofcourse its supposed to be near samp03xsvr
Reply
#3

Okay, than why did i get error with "done"?
Reply
#4

FIXED
Reply
#5

Experiencing same problem, how can I fix this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)