Advertisement
Guest User

Untitled

a guest
May 13th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #!/bin/bash
  2. # Server restart
  3. screen_name=dm
  4. port=27015
  5. dir=/home/steam/deathmatch
  6. start=./start_silent
  7.  
  8.  
  9. scrsend()
  10. {
  11. screen -S dm -p 0 -X stuff "$1^M"
  12. }
  13.  
  14. scrsend "sm_say Server is going for planned restart. You will be reconnected."
  15. sleep 1
  16. scrsend "sm_say Server restarting in 30 seconds ..."
  17. sleep 10
  18. scrsend "sm_say Server restarting in 20 seconds ..."
  19. sleep 10
  20. scrsend "sm_say Server restarting in 10 seconds ..."
  21. sleep 5
  22. scrsend "sm_say Server restarting in 5 seconds ..."
  23. sleep 1
  24. scrsend "sm_say Server restarting in 4 seconds ..."
  25. sleep 1
  26. scrsend "sm_say Server restarting in 3 seconds ..."
  27. sleep 1
  28. scrsend "sm_say Server restarting in 2 seconds ..."
  29. sleep 1
  30. scrsend "sm_say Server restarting in 1 seconds ..."
  31. sleep 1
  32.  
  33.  
  34. scrsend sm_retryandrestart
  35. sleep 5
  36. kill $(screen -ls | grep dm | awk -F . {'print $1'})
  37. #sleep 2
  38.  
  39. cd $dir && $start #not sure why I have this here, lol. It works but seems lame a bit :D
  40. sleep 3
  41. taskset -cp 7 $(ps aux | grep $port | grep ./srcds_linux | awk {'print $2'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement