SA-MP Forums Archive
Issue with auto restart. Giving +REP. - 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: Issue with auto restart. Giving +REP. (/showthread.php?tid=501510)



Issue with auto restart. Giving +REP. - Kyle - 18.03.2014

I get this error on my linux server for the SA-MP Auto restart script.



This is the code:

Код:
USERNAME=adminfuture
SERVER_EXE=samp03svr
 
## Checking that there is $1
if [ ! $USERNAME ]
        then
        echo "USAGE: ./killserv.sh [USERNAME]"
        echo "Warning: The server should be offline."
        exit 1
fi
 
cd /home/$USERNAME/samp03/
 
PROCESSCOUNT=$(ps -fu $USERNAME | grep $SERVER_EXE | grep -v grep | wc -l)
 
case $PROCESSCOUNT in
        0)
                nohup ./$SERVER_EXE &
                echo "Server started for user $USERNAME."
                ;;
        *)  
                PROCESS_ID=$(pidof /home/$USERNAME/sa-mp/$SERVER_EXE)
                echo A Server is already running for user $USERNAME.
                echo You can use ./killserv $USERNAME in order to start the server.
                ;;
        9999)
                echo WARNING!! User $USERNAME has more than once process.
                ;;
esac
Thanks


Re: Issue with auto restart. Giving +REP. - MP2 - 18.03.2014

Nothing to do with PAWN or SA-MP.