allow upgrader null sqlroot password

allow upgrader a null sql root password
This commit is contained in:
itiligent 2025-07-05 12:19:15 +10:00
parent 50b2935457
commit 909970fe9e
2 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -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} <guacamole-auth-jdbc-${NEW_GUAC_VERSION}/mysql/schema/upgrade/${FILE} &>>${INSTALL_LOG}
if [[ ! -z "$MYSQL_ROOT_PWD" ]]; then
mysql -u root -p${MYSQL_ROOT_PWD} -D ${GUAC_DB} -h ${MYSQL_HOST} -P ${MYSQL_PORT} <guacamole-auth-jdbc-${NEW_GUAC_VERSION}/mysql/schema/upgrade/${FILE} &>>${INSTALL_LOG}
else
mysql -u root -D ${GUAC_DB} -h ${MYSQL_HOST} -P ${MYSQL_PORT} <guacamole-auth-jdbc-${NEW_GUAC_VERSION}/mysql/schema/upgrade/${FILE} &>>${INSTALL_LOG}
fi
fi
done
if [[ $? -ne 0 ]]; then