Есть скрипт автообновления игры Garry's Mod:
[HIDE-REPLY-THANKS]
# !/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/$STEAM/$GAMES/$DIR" ]; then
mkdir -p "$HOME/$STEAM/$GAMES/$DIR"
fi
# Uh-oh, it looks like we still have no directory. Report an error.
if [ ! -d "$HOME/$STEAM/$GAMES/$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
./home/steam/cmd/steamcmd.sh +login anonymous +force_install_dir "$HOME/$STEAM/$GAMES/$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 "gmod_sandbox"
# Add any additional servers here by repeating the above, but using a different directory name.
# update_server 232250 "content/tf2"
update_server 232330 "content/css"
# Exit with status code 0 ( which means OK )
exit 0
[/HIDE-REPLY-THANKS]
При запуске sh update_gmod.sh пишет:
[HIDE-REPLY-THANKS]
update_gmod.sh: 25: update_gmod.sh: ./home/steam/cmd./steamcmd.sh: not found
[/HIDE-REPLY-THANKS]
Не могу понять, как правильно указать путь, что бы он открыл файл. Я обновлял библиотеки при помощи:
[HIDE-REPLY-THANKS]
sudo apt-get install lib32stdc++6
dpkg --add-architecture i386
apt-get update
apt-get install lib32gcc1
[/HIDE-REPLY-THANKS]
Формат поменял на unix
Когда я лично пишу ./steamcmd.sh, то всё нормально читает, но скрипт не выполняет эту функцию. Как исправить?
[HIDE-REPLY-THANKS]
# !/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/$STEAM/$GAMES/$DIR" ]; then
mkdir -p "$HOME/$STEAM/$GAMES/$DIR"
fi
# Uh-oh, it looks like we still have no directory. Report an error.
if [ ! -d "$HOME/$STEAM/$GAMES/$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
./home/steam/cmd/steamcmd.sh +login anonymous +force_install_dir "$HOME/$STEAM/$GAMES/$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 "gmod_sandbox"
# Add any additional servers here by repeating the above, but using a different directory name.
# update_server 232250 "content/tf2"
update_server 232330 "content/css"
# Exit with status code 0 ( which means OK )
exit 0
[/HIDE-REPLY-THANKS]
При запуске sh update_gmod.sh пишет:
[HIDE-REPLY-THANKS]
update_gmod.sh: 25: update_gmod.sh: ./home/steam/cmd./steamcmd.sh: not found
[/HIDE-REPLY-THANKS]
Не могу понять, как правильно указать путь, что бы он открыл файл. Я обновлял библиотеки при помощи:
[HIDE-REPLY-THANKS]
sudo apt-get install lib32stdc++6
dpkg --add-architecture i386
apt-get update
apt-get install lib32gcc1
[/HIDE-REPLY-THANKS]
Формат поменял на unix
Когда я лично пишу ./steamcmd.sh, то всё нормально читает, но скрипт не выполняет эту функцию. Как исправить?