Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.13 KB | None | 0 0
  1. # !/bin/bash
  2.  
  3. # A convenience function, to save us some work
  4. update_server() {
  5.     # Read the app id and the directory into a variable
  6.  
  7.     APP_ID=$1
  8.     DIR=$2
  9.  
  10.     # Create the directory ( if it does not exist already )
  11.     if [ ! -d "$HOME/$DIR" ]; then
  12.         mkdir -p "$HOME/$DIR"
  13.     fi
  14.  
  15.     # Uh-oh, it looks like we still have no directory. Report an error.
  16.     if [ ! -d "$HOME/$DIR" ]; then
  17.         # Describe what went wrong
  18.         echo "ERROR! Cannot create directory $HOME/$DIR!"
  19.  
  20.         # Exit with status code 1 ( which indicates an error )
  21.         exit 1
  22.     fi
  23.  
  24.     # Call SteamCMD with the app ID we provided and tell it to install
  25.     ./bin/steamcmd.sh +login anonymous +force_install_dir "$HOME/$DIR" +app_update $APP_ID validate +quit
  26. }
  27.  
  28. # Now the script actually runs update_server ( which we just declared above ) with the id of the application ( 4020 is Garry's Mod ) and the name of the directory we want the server to be hosted from:
  29.  
  30. update_server 4020 "server_1"
  31.  
  32. # Add any additional servers here by repeating the above, but using a different directory name.
  33. update_server 232330 "content/cstrike"
  34. # Exit with status code 0 ( which means OK )
  35. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement