18.03.2014, 18:06
I get this error on my linux server for the SA-MP Auto restart script.
This is the code:
Thanks
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