Advertisement
Guest User

Untitled

a guest
Feb 20th, 2014
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. Auto-start script by Ar2rJke (Translated from Russian)
  2. 1. Create a file with any name, I have this: rbm_autostart.sh
  3. 2. Insert the newly created file code:
  4. Code:
  5. #!/bin/sh ps afx | grep -v grep | grep -q ./rbmod.pl || cd /home/archi/Other/RbMod/ && screen -d -m -S rb ./rbmod.pl
  6.  
  7. 3. Instead "/home/archi/Other/RbMod/" - specify path to launch mod. Then save the file.
  8. 4. Now, you want to add it to the cron: write "crontab -e" and add....
  9. Code:
  10. */2 * * * * cd /home/archi/Other/Scripts && sh rbm_autostart.sh
  11. # - */2 * * * * - in the process of checking every 2 minutes.
  12. # - /home/archi/Other/Scripts - specify path to the script rbm_autostart.sh
  13. 5. Now, look to see that it's executed with: screen -ls, we'll see something like:
  14. Code:
  15. There are screens on: 11143.rb (07.10.2012 11:10:01) (Detached) 1 Sockets in /var/run/screen/S-user.
  16. 6.- Then go to the process: screen -r rb
  17. # - rb - session title screen
  18.  
  19. What do we see after all this?
  20.  
  21. 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.
  22. @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