klekSu
Stroke my ego.
- Joined
- Nov 4, 2008
- Messages
- 1,285
- Reaction score
- 18
Hello otlanders!
Let me present you a simple linux restarter script for your servers.
1. First of all install screen, for example in Debian by typing this -> apt-get install screen, then create following files.
2. File /etc/init.d/ots_restarter
3. File /etc/init.d/ots_restarter_script
4. Change otsScreenName to any name you wish.
5. Change userNotRoot to your linux user name other than main administrator root.
6. Now you can run your ot by typing /etc/init.d/ots_restarter and you can see how it works by typing screen -r ots, remember do NOT hit ctrl+c because that will restart your screen such as your ots. To quit screen but keep it running hit ctrl+a+d.
Let me present you a simple linux restarter script for your servers.
1. First of all install screen, for example in Debian by typing this -> apt-get install screen, then create following files.
2. File /etc/init.d/ots_restarter
Code:
#! /bin/bash
screen -A -m -d -S otsScreenName /etc/init.d/ots_restarter_script
3. File /etc/init.d/ots_restarter_script
Code:
#!/bin/bash
while [ 1 ]; do
cd /home/otsFolder
echo "Restarting Ots"
su userNotRoot -c ./theforgottenserver
done
5. Change userNotRoot to your linux user name other than main administrator root.
6. Now you can run your ot by typing /etc/init.d/ots_restarter and you can see how it works by typing screen -r ots, remember do NOT hit ctrl+c because that will restart your screen such as your ots. To quit screen but keep it running hit ctrl+a+d.