Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Auto-start script by Ar2rJke (Translated from Russian)
- 1. Create a file with any name, I have this: rbm_autostart.sh
- 2. Insert the newly created file code:
- Code:
- #!/bin/sh ps afx | grep -v grep | grep -q ./rbmod.pl || cd /home/archi/Other/RbMod/ && screen -d -m -S rb ./rbmod.pl
- 3. Instead "/home/archi/Other/RbMod/" - specify path to launch mod. Then save the file.
- 4. Now, you want to add it to the cron: write "crontab -e" and add....
- Code:
- */2 * * * * cd /home/archi/Other/Scripts && sh rbm_autostart.sh
- # - */2 * * * * - in the process of checking every 2 minutes.
- # - /home/archi/Other/Scripts - specify path to the script rbm_autostart.sh
- 5. Now, look to see that it's executed with: screen -ls, we'll see something like:
- Code:
- There are screens on: 11143.rb (07.10.2012 11:10:01) (Detached) 1 Sockets in /var/run/screen/S-user.
- 6.- Then go to the process: screen -r rb
- # - rb - session title screen
- What do we see after all this?
- After, the script will look for the specified process every 2 minutes, if the script does not see the mod process, the script starts it automatically, if the mod is in the process list, it will ignore it.
- @reboot - Do not ask ... The script will be in touch with the mod, so there is no need.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement