2017-08-02 12:27:53 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-08-22 04:55:35 +02:00
|
|
|
# Version Numbers of Guacamole and MySQL Connector/J to download
|
2017-08-01 15:12:56 +02:00
|
|
|
VERSION="0.9.13"
|
2017-08-01 15:15:07 +02:00
|
|
|
MCJVERSION="5.1.43"
|
2017-07-22 00:49:40 +02:00
|
|
|
|
2017-08-02 13:24:36 +02:00
|
|
|
# I'm assuming tomcat8, you can change it here...
|
|
|
|
TOMCAT="tomcat8"
|
|
|
|
|
2017-03-10 22:13:26 +01:00
|
|
|
SERVER=$(curl -s 'https://www.apache.org/dyn/closer.cgi?as_json=1' | jq --raw-output '.preferred|rtrimstr("/")')
|
2017-02-04 04:19:36 +01:00
|
|
|
|
2017-08-22 04:55:35 +02:00
|
|
|
# Stop tomcat
|
2017-08-02 13:24:36 +02:00
|
|
|
service ${TOMCAT} stop
|
2017-02-04 04:19:36 +01:00
|
|
|
|
2017-08-22 04:55:35 +02:00
|
|
|
# Download and install Guacamole server
|
2017-03-12 19:34:07 +01:00
|
|
|
wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/source/guacamole-server-${VERSION}-incubating.tar.gz
|
|
|
|
tar -xzf guacamole-server-${VERSION}-incubating.tar.gz
|
|
|
|
cd guacamole-server-${VERSION}-incubating
|
2017-02-04 04:19:36 +01:00
|
|
|
./configure --with-init-dir=/etc/init.d
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
ldconfig
|
|
|
|
systemctl enable guacd
|
|
|
|
cd ..
|
|
|
|
|
2017-08-22 04:55:35 +02:00
|
|
|
# Download and replace Guacamole client
|
2017-03-12 19:34:07 +01:00
|
|
|
wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/binary/guacamole-${VERSION}-incubating.war
|
2017-03-31 04:10:52 +02:00
|
|
|
mv guacamole-${VERSION}-incubating.war /etc/guacamole/guacamole.war
|
2017-02-04 04:19:36 +01:00
|
|
|
|
|
|
|
# Download and upgrade SQL components
|
2017-03-12 19:34:07 +01:00
|
|
|
wget ${SERVER}/incubator/guacamole/${VERSION}-incubating/binary/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/
|
2017-02-04 04:19:36 +01:00
|
|
|
|
2017-08-22 04:55:35 +02:00
|
|
|
# Upgrade the MySQL Connector/J
|
2017-07-22 00:49:40 +02:00
|
|
|
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}*
|
|
|
|
|
2017-07-18 01:05:08 +02:00
|
|
|
# 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
|
2017-02-04 04:19:36 +01:00
|
|
|
|
2017-08-22 04:55:35 +02:00
|
|
|
# Start tomcat
|
2017-08-02 13:24:36 +02:00
|
|
|
service ${TOMCAT} start
|
2017-02-04 04:19:36 +01:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rm -rf guacamole*
|