Advertisement
tjone270

QuakeUpdate.sh

Sep 19th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.90 KB | None | 0 0
  1. #! /bin/bash
  2. # quakestart.sh - quake live multiple server update script, utilising steamcmd.
  3. # created by Thomas Jones on 09/09/15.
  4. # purger@tomtecsolutions.com
  5.  
  6. # Defining variables.
  7. steamUser=""
  8. steamPass=""
  9. rconPass=""
  10. highestPort=28969
  11. message="^4The Purgery^7 servers are going down ^4within a minute^7 for daily updating. They will be back in ^45 minutes^7."
  12.  
  13. echo "========== QuakeUpdate.sh has started. =========="
  14. # Informing players in the servers that the servers are going down for a bit.
  15. counter=28960
  16. while [ $counter -le $highestPort ]
  17. do
  18.     echo Telling players in server port $counter that the servers are going down...
  19.     /home/qlserver/steamcmd/steamapps/common/qlds/rcon.py --host tcp://127.0.0.1:$counter --password "$rconPass" --command "say $message"
  20.     ((counter++))
  21. done
  22.  
  23. # Using 'supervisorctl' to stop all servers.
  24. echo Stopping Quake Servers...
  25. /usr/local/bin/supervisorctl stop all
  26.  
  27. # Running 'steamcmd' to update qzeroded
  28. echo Updating Quake Server...
  29. /home/qlserver/steamcmd/steamcmd.sh +login "$steamUser" "$steamPass" +force_install_dir /home/qlserver/steamcmd/steamapps/common/qlds/ +app_update 349090 +quit
  30.  
  31. # Replacing the steam configuration, which so politely replaces my
  32. # nice configuration for it's one, primarily for 'com_hunkmegs 60' reasons.
  33. echo Replacing new config. with old good config, and backing up new config.
  34. mv -fv /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/server.cfg /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/server.bak
  35. cp -Rfv /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/goodserver.cfg /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/server.cfg
  36.  
  37. # Replacing the steam-deployed access file, which so politely replaces my
  38. # nice access file for it's one.
  39. echo Replacing new access file. with old good access file, and backing up new access file.
  40. mv -fv /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/access.txt /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/access.bak
  41. cp -Rfv /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/goodaccess.txt /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/access.txt
  42.  
  43. # Replacing the steam-deployed workshop file, which so politely replaces my
  44. # nice workshop file for it's one.
  45. echo Replacing new workshop file. with old good workshop file, and backing up new workshop file.
  46. mv -fv /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/workshop.txt /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/workshop.bak
  47. cp -Rfv /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/goodworkshop.txt /home/qlserver/steamcmd/steamapps/common/qlds/baseq3/workshop.txt
  48.  
  49. # Removing the .quakelive directories, except for baseq3.
  50. echo Removing 2* directories...
  51. rm -rf /home/qlserver/.quakelive/2*
  52.  
  53. # Using 'supervisorctl' to start all servers.
  54. echo Starting Quake Servers...
  55. /usr/local/bin/supervisorctl start all
  56.  
  57. # Pretty obvious what's happening now.
  58. echo Exiting...
  59. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement