mirror of
https://github.com/MysticRyuujin/guac-install.git
synced 2023-10-10 13:36:56 +02:00
parent
5d3eac71f8
commit
714ae7f20d
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Try to get database from /etc/guacamole/guacamole.properties
|
# Try to get database from /etc/guacamole/guacamole.properties
|
||||||
DATABASE=$(grep -oP 'mysql-database:\K.*' /etc/guacamole/guacamole.properties | awk '{print $1}')
|
DATABASE=$(grep -oP 'mysql-database:\K.*' /etc/guacamole/guacamole.properties | awk '{print $1}')
|
||||||
|
MYSQL_SERVER=$(grep -oP ‘mysql-hostname:\K.*’ /etc/guacamole/guacamole.properties | awk ‘{print $1}’)
|
||||||
|
|
||||||
# Get MySQL root password
|
# Get MySQL root password
|
||||||
echo
|
echo
|
||||||
@ -10,7 +11,7 @@ do
|
|||||||
read -s -p "Enter MySQL ROOT Password: " mysqlrootpassword
|
read -s -p "Enter MySQL ROOT Password: " mysqlrootpassword
|
||||||
export MYSQL_PWD=${mysqlrootpassword}
|
export MYSQL_PWD=${mysqlrootpassword}
|
||||||
echo
|
echo
|
||||||
mysql -u root ${DATABASE} -e"quit" && break
|
mysql -u root -h ${MYSQL_SERVER} ${DATABASE} -e"quit" && break
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
@ -81,7 +82,7 @@ do
|
|||||||
if [[ $(echo -e "${FILEVERSION}\n${OLDVERSION}" | sort -V | head -n1) == ${OLDVERSION} && ${FILEVERSION} != ${OLDVERSION} ]]
|
if [[ $(echo -e "${FILEVERSION}\n${OLDVERSION}" | sort -V | head -n1) == ${OLDVERSION} && ${FILEVERSION} != ${OLDVERSION} ]]
|
||||||
then
|
then
|
||||||
echo "Patching ${DATABASE} with ${FILE}"
|
echo "Patching ${DATABASE} with ${FILE}"
|
||||||
mysql -u root ${DATABASE} < guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/upgrade/${FILE}
|
mysql -u root -h ${MYSQL_SERVER} ${DATABASE} < guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/upgrade/${FILE}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user