Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Server restart
- screen_name=dm
- port=27015
- dir=/home/steam/deathmatch
- start=./start_silent
- scrsend()
- {
- screen -S dm -p 0 -X stuff "$1^M"
- }
- scrsend "sm_say Server is going for planned restart. You will be reconnected."
- sleep 1
- scrsend "sm_say Server restarting in 30 seconds ..."
- sleep 10
- scrsend "sm_say Server restarting in 20 seconds ..."
- sleep 10
- scrsend "sm_say Server restarting in 10 seconds ..."
- sleep 5
- scrsend "sm_say Server restarting in 5 seconds ..."
- sleep 1
- scrsend "sm_say Server restarting in 4 seconds ..."
- sleep 1
- scrsend "sm_say Server restarting in 3 seconds ..."
- sleep 1
- scrsend "sm_say Server restarting in 2 seconds ..."
- sleep 1
- scrsend "sm_say Server restarting in 1 seconds ..."
- sleep 1
- scrsend sm_retryandrestart
- sleep 5
- kill $(screen -ls | grep dm | awk -F . {'print $1'})
- #sleep 2
- cd $dir && $start #not sure why I have this here, lol. It works but seems lame a bit :D
- sleep 3
- taskset -cp 7 $(ps aux | grep $port | grep ./srcds_linux | awk {'print $2'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement