Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.56 KB | None | 0 0
  1. #!/bin/bash
  2. SERVICE_IRC='Unreal3.2'
  3. SERVICE_ANOPE='services'
  4. SERVICE_FENRIR='Fenrir.conf'
  5.  
  6. if ps ax | grep -v grep |grep $SERVICE_IRC > /dev/null
  7. then
  8. #   echo "`date +%H:%M` $SERVICE_IRC running. OK!"
  9.     echo "Unreal3.2 OK" >> /dev/null
  10. else
  11.     echo "`date +%H:%M` $SERVICE_IRC is not running! Attempting to start!"
  12.     sh /home/simon/Unreal3.2/unreal start
  13.     echo "`date +%H:%M` $SERVICE_IRC is not running! Attempted to start, please check to make sure $SERVICE_IRC is running!" | mailx -s "`date +%H:%M` $SERVICE_IRC down!" sphilipp10@gmail.com
  14. fi
  15.  
  16. if ps ax | grep -v grep |grep $SERVICE_ANOPE > /dev/null
  17. then
  18. #   echo "`date +%H:%M` $SERVICE_ANOPE running. OK!"
  19.     echo "Anope OK" >> /dev/null
  20. else
  21.     echo "`date +%H:%M` $SERVICE_ANOPE is not running! Attempting to start!"
  22.    
  23. #   This results in syntax errors when run like this
  24. #   sh /home/simon/anope/services
  25.     echo "`date +%H:%M` $SERVICE_ANOPE is not running! Attempted to start, please check to make sure $SERVICE_ANOPE is running!" | mailx -s "`date +%H:%M` $SERVICE_ANOPE down!" sphilipp10@gmail.com
  26. fi
  27.  
  28. if ps ax | grep -v grep |grep $SERVICE_FENRIR > /dev/null
  29. then
  30. #   echo "`date +%H:%M` $SERVICE_FENRIR running. OK!"
  31.     echo "Fenrir OK" >> /dev/null
  32. else
  33.     echo "`date +%H:%M` $SERVICE_FENRIR is not running! Attempting to start!"
  34.  
  35. #   This results in syntax errors when run like this
  36. #   sh /home/simon/eggdrop/Fenrir.conf
  37.     echo "`date +%H:%M` $SERVICE_FENRIR is not running! Attempted to start, please check to make sure $SERVICE_IRC is running!" | mailx -s "`date +%H:%M` $SERVICE_FENRIR down!" sphilipp10@gmail.com
  38. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement