kito2
www.masteria.net
How to create a restarter that checks if the process is on, it is isn't, it run the server... maybe a crontab? Any ideas or suggestions?
- - - Updated - - -
BUMP?
- - - Updated - - -
BUMP?
Rename your execute for tfs.chmod 777 tfs
Next:adduser tfs
Acess the directory your OT.su tfs
./tfs.sh&
#!/bin/bash
if [ "$(pidof forgottenserver)" ]
then
# process was found
else
# process not found
./forgottenserver
fi
I'm not sure that I understand you correctly (so sorry about it but I got lacks in English). You don't have to use command "cd". You can create shortcut to your executable file - example:snejk I like your crontab, but pidof reads the process name right? And ./forottenserver should first do a cd to the directory?
ln -s /home/kito2/forgottenserver/forgottenserver /usr/bin/forgottenserver
#!/bin/bash
if [ "$(pidof forgottenserver)" ]
then
# process was found
else
# process not found
forgottenserver
fi
#!/bin/bash
ulimit -c unlimited
while true; do
cd /home/server
./theforgottenserver
sleep 5
done
Well go to your Filezilla or Winscp and make 1 file name:
restarter.sh
now inside put this script:
Code:#!/bin/bash ulimit -c unlimited while true; do cd /home/server ./theforgottenserver sleep 5 done
Edit: cd /home/server <- for where are your theforgottenserver in your dedicated.
now in putty give
chmod -R 777 restarter.sh
and remember: for start your server don't use more
./theforgottenserver
now use
./restarter.sh
or
./rest*
is same![]()
But how it works Cronox? Cause I try to understand it and can't get it... while true; do... but it shouldn't be while false? Since it would return a false if the process isn't running? And also how it check if the process is running... I mean it wouldn't open multiple times the server?