mirror of
https://git.koehlerweb.org/frodovdr/guac-install
synced 2025-07-06 19:13:32 +02:00
0.9.14 fixes (#28)
* Replace VERSION with GUACVERSION #26 #25 * Make database name dynamic from the guacamole.properties file #27
This commit is contained in:
@ -79,52 +79,49 @@ libswscale-dev libfreerdp-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvnc
|
||||
libvorbis-dev libwebp-dev mysql-server mysql-client mysql-common mysql-utilities ${TOMCAT} freerdp ghostscript wget dpkg-dev
|
||||
|
||||
# If apt fails to run completely the rest of this isn't going to work...
|
||||
if [ $? != 0 ]; then
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "apt failed to install all required dependencies"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Set SERVER to be the preferred download server from the Apache CDN
|
||||
SERVER="http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/${VERSION}"
|
||||
|
||||
# Quick Fix SERVER
|
||||
VERSION=$GUACVERSION
|
||||
SERVER="http://apache.org/dyn/closer.cgi?action=download&filename=guacamole/${GUACVERSION}"
|
||||
|
||||
# Download Guacamole Server
|
||||
wget -O guacamole-server-${VERSION}.tar.gz ${SERVER}/source/guacamole-server-${VERSION}.tar.gz
|
||||
if [ ! -f ./guacamole-server-${VERSION}.tar.gz ]; then
|
||||
echo "Failed to download guacamole-server-${VERSION}.tar.gz"
|
||||
echo "${SERVER}/source/guacamole-server-${VERSION}.tar.gz"
|
||||
wget -O guacamole-server-${GUACVERSION}.tar.gz ${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to download guacamole-server-${GUACVERSION}.tar.gz"
|
||||
echo "${SERVER}/source/guacamole-server-${GUACVERSION}.tar.gz"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Download Guacamole Client
|
||||
wget -O guacamole-${VERSION}.war ${SERVER}/binary/guacamole-${VERSION}.war
|
||||
if [ ! -f ./guacamole-${VERSION}.war ]; then
|
||||
echo "Failed to download guacamole-${VERSION}.war"
|
||||
echo "${SERVER}/binary/guacamole-${VERSION}.war"
|
||||
wget -O guacamole-${GUACVERSION}.war ${SERVER}/binary/guacamole-${GUACVERSION}.war
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to download guacamole-${GUACVERSION}.war"
|
||||
echo "${SERVER}/binary/guacamole-${GUACVERSION}.war"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Download Guacamole authentication extensions
|
||||
wget -O guacamole-auth-jdbc-${VERSION}.tar.gz ${SERVER}/binary/guacamole-auth-jdbc-${VERSION}.tar.gz
|
||||
if [ ! -f ./guacamole-auth-jdbc-${VERSION}.tar.gz ]; then
|
||||
echo "Failed to download guacamole-auth-jdbc-${VERSION}.tar.gz"
|
||||
echo "${SERVER}/binary/guacamole-auth-jdbc-${VERSION}.tar.gz"
|
||||
wget -O guacamole-auth-jdbc-${GUACVERSION}.tar.gz ${SERVER}/binary/guacamole-auth-jdbc-${GUACVERSION}.tar.gz
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to download guacamole-auth-jdbc-${GUACVERSION}.tar.gz"
|
||||
echo "${SERVER}/binary/guacamole-auth-jdbc-${GUACVERSION}.tar.gz"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Download MySQL Connector-J
|
||||
wget -O mysql-connector-java-${MCJVERSION}.tar.gz https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MCJVERSION}.tar.gz
|
||||
if [ ! -f ./mysql-connector-java-${MCJVERSION}.tar.gz ]; then
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to download mysql-connector-java-${MCJVERSION}.tar.gz"
|
||||
echo "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-${MCJVERSION}.tar.gz"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Extract Guacamole files
|
||||
tar -xzf guacamole-server-${VERSION}.tar.gz
|
||||
tar -xzf guacamole-auth-jdbc-${VERSION}.tar.gz
|
||||
tar -xzf guacamole-server-${GUACVERSION}.tar.gz
|
||||
tar -xzf guacamole-auth-jdbc-${GUACVERSION}.tar.gz
|
||||
tar -xzf mysql-connector-java-${MCJVERSION}.tar.gz
|
||||
|
||||
# Make directories
|
||||
@ -132,7 +129,7 @@ mkdir -p /etc/guacamole/lib
|
||||
mkdir -p /etc/guacamole/extensions
|
||||
|
||||
# Install guacd
|
||||
cd guacamole-server-${VERSION}
|
||||
cd guacamole-server-${GUACVERSION}
|
||||
./configure --with-init-dir=/etc/init.d
|
||||
make
|
||||
make install
|
||||
@ -144,11 +141,11 @@ cd ..
|
||||
BUILD_FOLDER=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
|
||||
# Move files to correct locations
|
||||
mv guacamole-${VERSION}.war /etc/guacamole/guacamole.war
|
||||
mv guacamole-${GUACVERSION}.war /etc/guacamole/guacamole.war
|
||||
ln -s /etc/guacamole/guacamole.war /var/lib/${TOMCAT}/webapps/
|
||||
ln -s /usr/local/lib/freerdp/guac*.so /usr/lib/${BUILD_FOLDER}/freerdp/
|
||||
cp mysql-connector-java-${MCJVERSION}/mysql-connector-java-${MCJVERSION}-bin.jar /etc/guacamole/lib/
|
||||
cp guacamole-auth-jdbc-${VERSION}/mysql/guacamole-auth-jdbc-mysql-${VERSION}.jar /etc/guacamole/extensions/
|
||||
cp guacamole-auth-jdbc-${GUACVERSION}/mysql/guacamole-auth-jdbc-mysql-${GUACVERSION}.jar /etc/guacamole/extensions/
|
||||
|
||||
# Configure guacamole.properties
|
||||
echo "mysql-hostname: localhost" >> /etc/guacamole/guacamole.properties
|
||||
@ -173,7 +170,7 @@ flush privileges;"
|
||||
echo $SQLCODE | mysql -u root -p$mysqlrootpassword
|
||||
|
||||
# Add Guacamole schema to newly created database
|
||||
cat guacamole-auth-jdbc-${VERSION}/mysql/schema/*.sql | mysql -u root -p$mysqlrootpassword guacamole_db
|
||||
cat guacamole-auth-jdbc-${GUACVERSION}/mysql/schema/*.sql | mysql -u root -p$mysqlrootpassword guacamole_db
|
||||
|
||||
# Cleanup
|
||||
rm -rf guacamole-*
|
||||
|
Reference in New Issue
Block a user