From 909110b4cbea790a01c7bd14677496572df018c3 Mon Sep 17 00:00:00 2001 From: DeathByDenim Date: Sun, 16 Apr 2023 15:34:47 -0400 Subject: [PATCH] Allow individual game installs to fail but keep installing the rest --- deploy.sh | 76 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 19 deletions(-) diff --git a/deploy.sh b/deploy.sh index b5a5041..45ed3db 100755 --- a/deploy.sh +++ b/deploy.sh @@ -90,25 +90,32 @@ cp console2web/console2web.py /usr/bin/console2web "$(dirname "$0")"/scripts/deploy_webserver.sh # Deploy the game servers -"$(dirname "$0")"/scripts/deploy_supertuxkart.sh -"$(dirname "$0")"/scripts/deploy_bzflag.sh -"$(dirname "$0")"/scripts/deploy_hedgewars.sh -"$(dirname "$0")"/scripts/deploy_lix.sh -"$(dirname "$0")"/scripts/deploy_mindustry.sh -"$(dirname "$0")"/scripts/deploy_minetest.sh -"$(dirname "$0")"/scripts/deploy_odamex.sh -"$(dirname "$0")"/scripts/deploy_openhv.sh -"$(dirname "$0")"/scripts/deploy_openspades.sh -"$(dirname "$0")"/scripts/deploy_teeworlds.sh -"$(dirname "$0")"/scripts/deploy_teeworlds-ddrace.sh -"$(dirname "$0")"/scripts/deploy_unvanquished.sh -"$(dirname "$0")"/scripts/deploy_xonotic.sh -"$(dirname "$0")"/scripts/deploy_xonotic-br.sh -"$(dirname "$0")"/scripts/deploy_armagetron_advanced.sh -"$(dirname "$0")"/scripts/deploy_opensoldat.sh -"$(dirname "$0")"/scripts/deploy_supertuxparty.sh -"$(dirname "$0")"/scripts/deploy_ufoai.sh -"$(dirname "$0")"/scripts/deploy_shatteredparadise.sh +games="\ +supertuxkart \ +bzflag \ +hedgewars \ +lix \ +mindustry \ +minetest \ +odamex \ +openhv \ +openspades \ +teeworlds \ +teeworlds-ddrace \ +unvanquished \ +xonotic \ +xonotic-br \ +armagetron_advanced \ +opensoldat \ +supertuxparty \ +ufoai \ +shatteredparadise" +failed_games="" +for game in $games; do + if ! "$(dirname "$0")"/scripts/deploy_${game}.sh; then + failed_games+="${game}\n" + fi +done # Apply all pending firewall rules. NGINX shouldn't have to be restarted, but it seems to help. firewall-cmd --reload @@ -116,3 +123,34 @@ systemctl restart nginx echo echo "Installation complete. Password is ${systempassword}" +if [ -n "$failed_games" ]; then + echo "The following games failed to install:" + echo -e "$failed_games" + echo + echo "Use /usr/local/bin/redeploy.sh [game] to try again" +fi + +cat > /usr/local/bin/redeploy.sh <