From 909970fe9ee81a566d66c0fcfc9f3dbe317b195d Mon Sep 17 00:00:00 2001 From: itiligent <94789708+itiligent@users.noreply.github.com> Date: Sat, 5 Jul 2025 12:19:15 +1000 Subject: [PATCH] allow upgrader null sqlroot password allow upgrader a null sql root password --- 1-setup.sh | 2 +- upgrade-guacamole.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index 9b9ada9..b9b3f71 100644 --- a/1-setup.sh +++ b/1-setup.sh @@ -152,7 +152,7 @@ CRON_DENY_FILE="/etc/cron.deny" # Distro's cron deny file # Script branding header echo -echo -e "${GREYB}Guacamole ${GUAC_VERSION} Auto Installer." +echo -e "${GREYB}Guacamole ${GUAC_VERSION} Appliance Auto Installer" echo -e " ${LGREEN}Powered by Itiligent" echo echo diff --git a/upgrade-guacamole.sh b/upgrade-guacamole.sh index 1f9f765..69af3d9 100644 --- a/upgrade-guacamole.sh +++ b/upgrade-guacamole.sh @@ -101,7 +101,7 @@ fi # Script branding header echo -echo -e "${GREYB}Guacamole Appliance Auto Upgrade Script." +echo -e "${GREYB}Guacamole Appliance Auto Upgrade Script" echo -e " ${LGREEN}Powered by Itiligent" echo @@ -231,7 +231,12 @@ if [[ "${INSTALL_MYSQL}" = true ]]; then FILEVERSION=$(echo ${FILE} | grep -oP 'upgrade-pre-\K[0-9\.]+(?=\.)') if [[ $(echo -e "${FILEVERSION}\n${OLD_GUAC_VERSION}" | sort -V | head -n1) == ${OLD_GUAC_VERSION} && ${FILEVERSION} != ${OLD_GUAC_VERSION} ]]; then echo "Patching ${GUAC_DB} with ${FILE}" - mysql -u root -D ${GUAC_DB} -h ${MYSQL_HOST} -P ${MYSQL_PORT} >${INSTALL_LOG} + + if [[ ! -z "$MYSQL_ROOT_PWD" ]]; then + mysql -u root -p${MYSQL_ROOT_PWD} -D ${GUAC_DB} -h ${MYSQL_HOST} -P ${MYSQL_PORT} >${INSTALL_LOG} + else + mysql -u root -D ${GUAC_DB} -h ${MYSQL_HOST} -P ${MYSQL_PORT} >${INSTALL_LOG} + fi fi done if [[ $? -ne 0 ]]; then