1
0
mirror of https://github.com/MysticRyuujin/guac-install.git synced 2023-10-10 13:36:56 +02:00
guac-install/guac-install-server.sh
SoulSeekkor 2c29ba8231
Add Optional MySQL Support (#99)
* Added missing package for guac-install-server.sh.

* Minor cleanup of Duo configuration settings.

* Prompt test.

* Working on adding prompts and replacing MySQL information with variables.

* Improved switch/variable management and checking, only prompt for values not already passed via command line switches.

* Removed variable that shouldn't be there.

* Updated switches.

* Updated readme to include new information and all switches.

* Updated readme again.

* -Updated variables and switches to match install script.
-Added check for MySQL host, prompt if necessary.

* Updated scripts to use given MySQL host/port when executing scripts.

* Fixed typo and removed line that always fails.

* More fixes.

* Added line back in.

* Added starting services message to upgrade script.
2020-02-09 18:40:11 -05:00

81 lines
2.1 KiB
Bash

#!/bin/bash
# Version number of Guacamole to install
GUACVERSION="1.1.0"
# Ubuntu and Debian have different names of the libjpeg-turbo library for some reason...
source /etc/os-release
if [[ "${NAME}" == "Ubuntu" ]]
then
JPEGTURBO="libjpeg-turbo8-dev"
if [[ "${VERSION_ID}" == "16.04" ]]
then
LIBPNG="libpng12-dev"
else
LIBPNG="libpng-dev"
fi
elif [[ "${NAME}" == *"Debian"* ]]
then
JPEGTURBO="libjpeg62-turbo-dev"
if [[ "${PRETTY_NAME}" == *"stretch"* ]]
then
LIBPNG="libpng-dev"
else
LIBPNG="libpng12-dev"
fi
else
echo "Unsupported Distro - Ubuntu or Debian Only"
exit
fi
# Install Server Features
apt update
apt -y install build-essential libcairo2-dev ${JPEGTURBO} ${LIBPNG} libossp-uuid-dev libavcodec-dev libavutil-dev \
libswscale-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev \
libvorbis-dev libwebp-dev jq curl wget libtool-bin libwebsockets-dev
# If apt fails to run completely the rest of this isn't going to work...
if [ $? != 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/${GUACVERSION}"
# Download Guacamole Server
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
# Extract Guacamole Files
tar -xzf guacamole-server-${GUACVERSION}.tar.gz
# Make Directories
mkdir /etc/guacamole
# Install guacd
cd guacamole-server-${GUACVERSION}
./configure --with-init-dir=/etc/init.d
make
make install
ldconfig
cd ..
# Configure guacamole.properties
echo "[server]" >> /etc/guacamole/guacd.conf
echo "bind_host = 0.0.0.0" >> /etc/guacamole/guacd.conf
echo "bind_port = 4822" >> /etc/guacamole/guacd.conf
# Configure startup
systemctl enable guacd
systemctl start guacd
# Cleanup
rm -rf guacamole-*