Advertisement
Guest User

server_update.sh

a guest
Jan 27th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.79 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. (
  4.   flock -x -w 10 200 || exit 1
  5.  
  6.         cd /home/tf2/
  7.         ./tools/updateCheck/steamUpdateCheck -i /home/tf2/server/.master/tf/steam.inf;
  8.  
  9.         if [ $? -ne 0 ] || [ "$1" == "force" ]; then
  10.                 tmux send-keys -t "xst" "say A TF2 update has been released and the server will attempt to update. Restart your game to grab it." C-m
  11.  
  12.                 ./steamcmd.sh +runscript update_tf_ds.txt;
  13.                 ./tools/updatesymlinks.sh;
  14.  
  15.                 sleep 3;
  16.  
  17.                 ./tools/updateCheck/steamUpdateCheck -i /home/tf2/server/.master/tf/steam.inf;
  18.  
  19.                 if [ $? -eq 0 ]; then
  20.                         echo " > Update successful. Proceeding to restart process.";
  21.                         echo " > 60 second notification...";
  22.                         tmux send-keys -t "xst" "say The server was successfully updated and will restart in 60 seconds." C-m;
  23.                         sleep 30;
  24.                         echo " > 30 second notification...";
  25.                         tmux send-keys -t "xst" "say The server was successfully updated and will restart in 30 seconds." C-m;
  26.                         sleep 20;
  27.                         echo " > 10 second notification...";
  28.                         tmux send-keys -t "xst" "say The server was successfully updated and will restart in 10 seconds." C-m;
  29.                         sleep 9;
  30.                         echo " > Restarting now...";
  31.                         tmux send-keys -t "xst" "say The server was successfully updated and will restart now." C-m;
  32.                         sleep 1;
  33.  
  34.                         ./tools/allservers.sh hard-restart;
  35.                 else
  36.                         echo " > Update failed. Not restarting server.";
  37.                 fi
  38.         fi
  39.  
  40. ) 200>/var/lock/tf2updatecheck
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement