1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +01:00

Add error handling for missing steamcmd

This commit is contained in:
aclist 2021-12-15 07:48:05 +09:00 committed by GitHub
parent 38d6316b63
commit 2b4d310e5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -160,7 +160,7 @@ move_files(){
} }
auto_mod_download(){ auto_mod_download(){
sudo -u $steamcmd_user steamcmd "steamcmd +force_install_dir $staging_dir +login $steam_username $(steamcmd_modlist) +quit" sudo -u $steamcmd_user steamcmd "steamcmd +force_install_dir $staging_dir +login $steam_username $(steamcmd_modlist) +quit"
[[ "$(ls -A $staging_dir/steamapps)" ]] && move_files || return 1 [[ "$(ls -A $staging_dir/steamapps)" ]] && move_files || return 1
} }
auto_mod_install(){ auto_mod_install(){
printf "[ERROR] Missing mods. Invoking steamcmd for user $steamcmd_user\n" printf "[ERROR] Missing mods. Invoking steamcmd for user $steamcmd_user\n"
@ -170,6 +170,10 @@ auto_mod_install(){
id $steamcmd_user &>/dev/null id $steamcmd_user &>/dev/null
[[ $? -eq 1 ]]; then [[ $? -eq 1 ]]; then
err "Invalid steamcmd user. Reverting to manual mode" err "Invalid steamcmd user. Reverting to manual mode"
elif
command -v steamcmd &>/dev/null
[[ $? -eq 1 ]]; then
err "steamcmd not installed. See: https://developer.valvesoftware.com/wiki/SteamCMD"
else else
printf "[INFO] Found steamcmd user. Downloading mods\n" printf "[INFO] Found steamcmd user. Downloading mods\n"
revert_msg="Something went wrong. Reverting to manual mode" revert_msg="Something went wrong. Reverting to manual mode"