Kylroi

down TrinityCore servers bash script

Oct 30th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.22 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. PID=`pgrep -u $USER authserver`
  4. if [ -n "$PID" ]; then
  5.   echo "Interrupting authserver then waiting 4 seconds."
  6.   kill -INT `pgrep -u $USER authserver`
  7.   sleep 4
  8.   PID=`pgrep -u $USER authserver`
  9.   if [ -n "$PID" ]; then
  10.     echo "Killing authserver - it didn't shut down properly."
  11.     kill -KILL `pgrep -u $USER authserver`
  12.     sleep 1
  13.   fi
  14. else
  15.   echo "authserver was not found running."
  16. fi
  17.  
  18. PID=`pgrep -u $USER bnetserver`
  19. if [ -n "$PID" ]; then
  20.   echo "Interrupting bnetserver then waiting 4 seconds."
  21.   kill -INT `pgrep -u $USER bnetserver`
  22.   sleep 4
  23.   PID=`pgrep -u $USER bnetserver`
  24.   if [ -n "$PID" ]; then
  25.     echo "Killing bnetserver - it didn't shut down properly."
  26.     kill -KILL `pgrep -u $USER bnetserver`
  27.     sleep 1
  28.   fi
  29. else
  30.   echo "bnetserver was not found running."
  31. fi
  32.  
  33. PID=`pgrep -u $USER worldserver`
  34. if [ -n "$PID" ]; then
  35.   echo "Interrupting worldserver, then waiting 10 seconds."
  36.   kill -INT `pgrep -u $USER worldserver`
  37.   sleep 10
  38.   PID=`pgrep -u $USER worldserver`
  39.   if [ -n "$PID" ]; then
  40.     echo "Killing worldserver in case it didn't shut down."
  41.     kill -KILL `pgrep -u $USER worldserver`
  42.     sleep 1
  43.   fi
  44. else
  45.   echo "worldserver was not found running."
  46. fi
Advertisement
Add Comment
Please, Sign In to add comment