From d1933dbae02dfa6965318fee7662d195c1ff56a4 Mon Sep 17 00:00:00 2001 From: Chase Wright Date: Tue, 3 Jan 2017 09:02:12 -0600 Subject: [PATCH] Added a check to exit script if apt-get fails If apt-get fails, likely due to missing dependencies or differing names outside of Ubuntu 16.04.01 LTS official sources, we should just exit and inform the user, no need to keep going... --- guac-install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/guac-install.sh b/guac-install.sh index d7d5267..8337599 100644 --- a/guac-install.sh +++ b/guac-install.sh @@ -10,6 +10,11 @@ read -s -p "Enter the password that will be used for the Guacamole database: " g # Install Features apt-get -y install libcairo2-dev libjpeg-turbo8-dev libpng12-dev libossp-uuid-dev libavcodec-dev libavutil-dev libswscale-dev libfreerdp-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev libvorbis-dev libwebp-dev mysql-server mysql-client mysql-common mysql-utilities tomcat8 freerdp ghostscript jq wget curl +if [ $? != 0 ] +then + echo "apt-get failed to install all required dependencies. Are you on Ubuntu 16.04.01 LTS?" + exit +fi # Add GUACAMOLE_HOME to Tomcat8 ENV echo "" >> /etc/default/tomcat8