1
0
mirror of https://git.koehlerweb.org/frodovdr/guac-install synced 2024-11-22 17:37:13 +01:00

Tidied up SSO function and replaced with correct download file

This commit is contained in:
Tom Maguire 2023-01-03 17:23:57 +00:00 committed by GitHub
parent 55ea4737a5
commit 8b129925e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,24 +197,27 @@ for file in /etc/guacamole/extensions/guacamole-auth-duo*.jar; do
fi fi
done done
function download_sso_auth () {
wget -q --show-progress -O guacamole-auth-sso-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-sso-${GUACVERSION}.tar.gz
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to download guacamole-auth-sso-${GUACVERSION}.tar.gz"
echo -e "${SERVER}/binary/guacamole-auth-sso-${GUACVERSION}.tar.gz"
exit 1
fi
echo -e "${GREEN}Downloaded guacamole-auth-sso-${GUACVERSION}.tar.gz${NC}"
tar -xzf guacamole-auth-sso-${GUACVERSION}.tar.gz
cp guacamole-auth-sso-${GUACVERSION}/saml/guacamole-auth-sso-saml-${GUACVERSION}.jar /etc/guacamole/extensions/
echo -e "${GREEN}SAML copied to extensions.${NC}"
break
}
# Handle upgrading SAML plugin if present # Handle upgrading SAML plugin if present
for file in /etc/guacamole/extensions/guacamole-auth-saml*.jar; do for file in /etc/guacamole/extensions/guacamole-auth-saml*.jar; do
if [[ -f $file ]]; then if [[ -f $file ]]; then
# Upgrade SAML # Upgrade SAML
echo -e "${BLUE}SAML extension was found, upgrading...${NC}" echo -e "${BLUE}SAML extension was found, upgrading...${NC}"
rm /etc/guacamole/extensions/guacamole-auth-sso-saml*.jar rm /etc/guacamole/extensions/guacamole-auth-saml*.jar
wget -q --show-progress -O guacamole-auth-sso-saml-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-sso-saml-${GUACVERSION}.tar.gz download_sso_auth
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
fi fi
done done
# Handle newer install/upgrade with different package name # Handle newer install/upgrade with different package name
@ -223,18 +226,7 @@ for file in /etc/guacamole/extensions/guacamole-auth-sso-saml*.jar; do
# Upgrade SAML # Upgrade SAML
echo -e "${BLUE}SAML extension was found, upgrading...${NC}" echo -e "${BLUE}SAML extension was found, upgrading...${NC}"
rm /etc/guacamole/extensions/guacamole-auth-sso-saml*.jar 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 download_sso_auth
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
fi fi
done done