1
0
mirror of https://github.com/MysticRyuujin/guac-install.git synced 2023-10-10 13:36:56 +02:00

Merge pull request #7 from MysticRyuujin/MSJV

MySQL Connector/J Upgrade
This commit is contained in:
Chase Wright 2017-07-21 17:50:57 -05:00 committed by GitHub
commit 4e2c96a84c
2 changed files with 15 additions and 4 deletions

View File

@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
# Version Numbers of Guacamole and MySQL Connection/J to download
VERSION="0.9.12" VERSION="0.9.12"
MCJVERSION = "5.1.43"
# Grab a password for MySQL Root # Grab a password for MySQL Root
read -s -p "Enter the password that will be used for MySQL Root: " mysqlrootpassword read -s -p "Enter the password that will be used for MySQL Root: " mysqlrootpassword
@ -34,12 +36,12 @@ echo "GUACAMOLE_HOME=/etc/guacamole" >> /etc/default/tomcat8
wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/source/guacamole-server-${VERSION}-incubating.tar.gz wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/source/guacamole-server-${VERSION}-incubating.tar.gz
wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/binary/guacamole-${VERSION}-incubating.war wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/binary/guacamole-${VERSION}-incubating.war
wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/binary/guacamole-auth-jdbc-${VERSION}-incubating.tar.gz wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/binary/guacamole-auth-jdbc-${VERSION}-incubating.tar.gz
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.41.tar.gz wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MCJVERSION}.tar.gz
# Extract Guacamole Files # Extract Guacamole Files
tar -xzf guacamole-server-${VERSION}-incubating.tar.gz tar -xzf guacamole-server-${VERSION}-incubating.tar.gz
tar -xzf guacamole-auth-jdbc-${VERSION}-incubating.tar.gz tar -xzf guacamole-auth-jdbc-${VERSION}-incubating.tar.gz
tar -xzf mysql-connector-java-5.1.41.tar.gz tar -xzf mysql-connector-java-${MCJVERSION}.tar.gz
# MAKE DIRECTORIES # MAKE DIRECTORIES
mkdir /etc/guacamole mkdir /etc/guacamole
@ -59,7 +61,7 @@ cd ..
mv guacamole-${VERSION}-incubating.war /etc/guacamole/guacamole.war mv guacamole-${VERSION}-incubating.war /etc/guacamole/guacamole.war
ln -s /etc/guacamole/guacamole.war /var/lib/tomcat8/webapps/ ln -s /etc/guacamole/guacamole.war /var/lib/tomcat8/webapps/
ln -s /usr/local/lib/freerdp/* /usr/lib/x86_64-linux-gnu/freerdp/. ln -s /usr/local/lib/freerdp/* /usr/lib/x86_64-linux-gnu/freerdp/.
cp mysql-connector-java-5.1.41/mysql-connector-java-5.1.41-bin.jar /etc/guacamole/lib/ cp mysql-connector-java-${MCJVERSION}/mysql-connector-java-${MCJVERSION}-bin.jar /etc/guacamole/lib/
cp guacamole-auth-jdbc-${VERSION}-incubating/mysql/guacamole-auth-jdbc-mysql-${VERSION}-incubating.jar /etc/guacamole/extensions/ cp guacamole-auth-jdbc-${VERSION}-incubating/mysql/guacamole-auth-jdbc-mysql-${VERSION}-incubating.jar /etc/guacamole/extensions/
# Configure guacamole.properties # Configure guacamole.properties
@ -91,4 +93,4 @@ cat guacamole-auth-jdbc-${VERSION}-incubating/mysql/schema/*.sql | mysql -u root
# Cleanup # Cleanup
rm -rf guacamole-* rm -rf guacamole-*
rm -rf mysql-connector-java-5.1.41* rm -rf mysql-connector-java-${MCJVERSION}*

View File

@ -1,4 +1,7 @@
# Version Numbers of Guacamole and MySQL Connection/J to download
VERSION="0.9.12" VERSION="0.9.12"
MCJVERSION = "5.1.43"
SERVER=$(curl -s 'https://www.apache.org/dyn/closer.cgi?as_json=1' | jq --raw-output '.preferred|rtrimstr("/")') SERVER=$(curl -s 'https://www.apache.org/dyn/closer.cgi?as_json=1' | jq --raw-output '.preferred|rtrimstr("/")')
# Stop Tomcat # Stop Tomcat
@ -24,6 +27,12 @@ wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/binary/guacamole-auth-j
tar -xzf guacamole-auth-jdbc-${VERSION}-incubating.tar.gz 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/ cp guacamole-auth-jdbc-${VERSION}-incubating/mysql/guacamole-auth-jdbc-mysql-${VERSION}-incubating.jar /etc/guacamole/extensions/
# Upgrade the MySQL Connector-J
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MCJVERSION}.tar.gz
tar -xzf mysql-connector-java-${MCJVERSION}.tar.gz
cp mysql-connector-java-${MCJVERSION}/mysql-connector-java-${MCJVERSION}-bin.jar /etc/guacamole/lib/
rm -rf mysql-connector-java-${MCJVERSION}*
# Check if there is an schema upgrade file, if there is run it (will prompt for password) # 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" ] if [ -f "guacamole-auth-jdbc-${VERSION}-incubating/mysql/schema/upgrade/upgrade-pre-${VERSION}.sql" ]
then then