From 42baa0e220b7deb0dba09ec611b4c02a316f0fe8 Mon Sep 17 00:00:00 2001 From: itiligent Date: Wed, 6 Sep 2023 17:53:16 +1000 Subject: [PATCH] fix root url redirect upgrade bug old method to shorten url breaks upgrades in /var/lib/${TOMCAT_VERSION}/webapps --- 2-install-guacamole.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/2-install-guacamole.sh b/2-install-guacamole.sh index af34174..5fbdcd3 100644 --- a/2-install-guacamole.sh +++ b/2-install-guacamole.sh @@ -599,10 +599,11 @@ expect eof fi if [ "${CHANGE_ROOT}" = true ]; then -echo -e "${GREY}Setting default Guacamole url to http root...${DGREY}" + echo -e "${GREY}Shortening the Guacamole root url and setting up redirect...${DGREY}" systemctl stop ${TOMCAT_VERSION} - rm -rf /var/lib/${TOMCAT_VERSION}/webapps/ROOT - mv /var/lib/${TOMCAT_VERSION}/webapps/guacamole.war /var/lib/${TOMCAT_VERSION}/webapps/ROOT.war + mv /var/lib/${TOMCAT_VERSION}/webapps/ROOT/index.html index.html.old + touch /var/lib/${TOMCAT_VERSION}/webapps/ROOT/index.jsp + echo "<% response.sendRedirect(\"/guacamole\");%>" >>/var/lib/${TOMCAT_VERSION}/webapps/ROOT/index.jsp systemctl start ${TOMCAT_VERSION} if [ $? -ne 0 ]; then echo -e "${LRED}Failed. See ${LOG_LOCATION}${GREY}" 1>&2