03.12.2008, 14:47
All you need to use the program below is a Linux environment, and the possibility to use cron. This program will check if the samp02svr process is running, and if it isn't, start it up again. You'll need to install the following crontab:
checksamp.sh:
Make sure that you have to correct paths set up, the script won't work if you haven't. The script is currently unable to handle multiple SA-MP Servers on the same machine, but works perfectly when there is only one running/needed. You need to chmod the checksamp.sh file to 0755 (+x)!
Код:
*/5 * * * * /path/to/samp/checksamp.sh
Код:
#!/bin/sh PROCESS_COUNT=$(ps -fu root | grep samp02svr | grep -v grep | wc -l) case $PROCESS_COUNT in 0) /path/to/samp02svr & ;; 1) #OK, program is already running once ;; *) #OK, program is already multiple times ;; esac