I am setting up a linux server for gaming and I am using a script to update the files automatically and create a folder with a certain name.
Code:
# !/bin/bash # A convenience function, to save us some work update_server() { # Read the app id and the directory into a variable APP_ID=$1 DIR=$2 # Create the directory ( if it does not exist already ) if [ ! -d "$HOME/$DIR" ]; then mkdir -p "$HOME/$DIR" fi # Uh-oh, it looks like we still have no directory. Report an error. if [ ! -d "$HOME/$DIR" ]; then # Describe what went wrong echo "ERROR! Cannot create directory $HOME/$DIR!" # Exit with status code 1 ( which indicates an error ) exit 1 fi # Call SteamCMD with the app ID we provided and tell it to install ./bin/steamcmd.sh +login anonymous +force_install_dir "$HOME/$DIR" +app_update $APP_ID validate +quit } # 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: update_server 4020 "gmodserver" exit 0
When I run this script, it creates 2 folders on my server : gmodserver and gmodserver? There is no files downloaded in gmodserver. All the files are downloaded in gmodserver?
I looked for a few hours on how to solve this problem but I have no idea what the added ? might be so I am lost as to what to look for. Could you help me on figuring this out?
Thank you.
edit : I am using ubuntu 15.04 x64 if it makes a difference.