automated schema upgrade check

If the schema upgrade needs to happen then the file name would exist with the current version's name so it's easy enough to check for and run if necessary.
This commit is contained in:
Chase Wright 2017-07-17 18:05:08 -05:00 committed by GitHub
parent 8e8b6056dc
commit 34c8f44543
1 changed files with 5 additions and 2 deletions

View File

@ -24,8 +24,11 @@ wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/binary/guacamole-auth-j
tar -xzf guacamole-auth-jdbc-${VERSION}-incubating.tar.gz
cp guacamole-auth-jdbc-${VERSION}-incubating/mysql/guacamole-auth-jdbc-mysql-${VERSION}-incubating.jar /etc/guacamole/extensions/
# Commented out this lines as there is no schema upgrade from 0.9.11 to 0.9.12
# mysql -u root -p guacamole_db < guacamole-auth-jdbc-${VERSION}-incubating/mysql/schema/upgrade/upgrade-pre-${VERSION}.sql
# Check if there is an schema upgrade file, if there is run it (will prompt for password)
if [ -f "guacamole-auth-jdbc-${VERSION}-incubating/mysql/schema/upgrade/upgrade-pre-${VERSION}.sql" ]
then
mysql -u root -p guacamole_db < guacamole-auth-jdbc-${VERSION}-incubating/mysql/schema/upgrade/upgrade-pre-${VERSION}.sql
fi
# Start Tomcat
service tomcat8 start