From 55ea4737a53736f5af18644866f20ae3f795f54d Mon Sep 17 00:00:00 2001 From: Tom Maguire Date: Tue, 3 Jan 2023 16:59:42 +0000 Subject: [PATCH] Fixed to match new package naming scheme for 1.4.0 --- guac-upgrade.sh | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/guac-upgrade.sh b/guac-upgrade.sh index 20799ac..873c10f 100755 --- a/guac-upgrade.sh +++ b/guac-upgrade.sh @@ -202,16 +202,36 @@ for file in /etc/guacamole/extensions/guacamole-auth-saml*.jar; do if [[ -f $file ]]; then # Upgrade SAML echo -e "${BLUE}SAML extension was found, upgrading...${NC}" - rm /etc/guacamole/extensions/guacamole-auth-saml*.jar - wget -q --show-progress -O guacamole-auth-saml-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-saml-${GUACVERSION}.tar.gz + rm /etc/guacamole/extensions/guacamole-auth-sso-saml*.jar + wget -q --show-progress -O guacamole-auth-sso-saml-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-sso-saml-${GUACVERSION}.tar.gz if [ $? -ne 0 ]; then - echo -e "${RED}Failed to download guacamole-auth-saml-${GUACVERSION}.tar.gz" - echo -e "${SERVER}/binary/guacamole-auth-saml-${GUACVERSION}.tar.gz" + echo -e "${RED}Failed to download guacamole-auth-sso-saml-${GUACVERSION}.tar.gz" + echo -e "${SERVER}/binary/guacamole-auth-sso-saml-${GUACVERSION}.tar.gz" exit 1 fi - echo -e "${GREEN}Downloaded guacamole-auth-saml-${GUACVERSION}.tar.gz${NC}" - tar -xzf guacamole-auth-saml-${GUACVERSION}.tar.gz - cp guacamole-auth-saml-${GUACVERSION}/guacamole-auth-saml-${GUACVERSION}.jar /etc/guacamole/extensions/ + echo -e "${GREEN}Downloaded guacamole-auth-sso-saml-${GUACVERSION}.tar.gz${NC}" + tar -xzf guacamole-auth-sso-saml-${GUACVERSION}.tar.gz + cp guacamole-auth-sso-saml-${GUACVERSION}/guacamole-auth-sso-saml-${GUACVERSION}.jar /etc/guacamole/extensions/ + echo -e "${GREEN}SAML copied to extensions.${NC}" + + break + fi +done +# Handle newer install/upgrade with different package name +for file in /etc/guacamole/extensions/guacamole-auth-sso-saml*.jar; do + if [[ -f $file ]]; then + # Upgrade SAML + echo -e "${BLUE}SAML extension was found, upgrading...${NC}" + rm /etc/guacamole/extensions/guacamole-auth-sso-saml*.jar + wget -q --show-progress -O guacamole-auth-sso-saml-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-sso-saml-${GUACVERSION}.tar.gz + if [ $? -ne 0 ]; then + echo -e "${RED}Failed to download guacamole-auth-sso-saml-${GUACVERSION}.tar.gz" + echo -e "${SERVER}/binary/guacamole-auth-sso-saml-${GUACVERSION}.tar.gz" + exit 1 + fi + echo -e "${GREEN}Downloaded guacamole-auth-sso-saml-${GUACVERSION}.tar.gz${NC}" + tar -xzf guacamole-auth-sso-saml-${GUACVERSION}.tar.gz + cp guacamole-auth-sso-saml-${GUACVERSION}/guacamole-auth-sso-saml-${GUACVERSION}.jar /etc/guacamole/extensions/ echo -e "${GREEN}SAML copied to extensions.${NC}" break