From 17fbb24d7484e9a40a2d9d0b5ddc41541fc6c98b Mon Sep 17 00:00:00 2001
From: Tech Perplexed <15312691+TechPerplexed@users.noreply.github.com>
Date: Mon, 28 Jan 2019 18:45:26 -0700
Subject: [PATCH] Update install.sh

---
 install/install.sh | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/install/install.sh b/install/install.sh
index 3438eb18..41e5b212 100644
--- a/install/install.sh
+++ b/install/install.sh
@@ -12,15 +12,19 @@ sudo ufw default allow outgoing
 sudo ufw allow ssh
 sudo ufw --force enable
 
-sudo rm -r /opt/Gooby
-sudo git clone -b master https://github.com/TechPerplexed/Gooby /opt/Gooby
+sudo rm -r /opt/.Gooby > /dev/null 2>&1
+sudo git clone -b master https://github.com/TechPerplexed/Gooby /opt/.Gooby
 
-sudo chmod +x -R /opt/Gooby/install
-sudo chmod +x -R /opt/Gooby/menus
-sudo chmod +x -R /opt/Gooby/scripts/bin
-sudo chmod +x -R /opt/Gooby/scripts/cron
-sudo rsync -a /opt/Gooby/scripts/bin/gooby /bin
-sudo chmod 755 /bin/gooby
+if [ -d /opt/.Gooby ]; then
+	sudo rm -r /opt/Gooby
+	sudo mv /opt/.Gooby /opt/Gooby
+	sudo chmod +x -R /opt/Gooby/install
+	sudo chmod +x -R /opt/Gooby/menus
+	sudo chmod +x -R /opt/Gooby/scripts/bin
+	sudo chmod +x -R /opt/Gooby/scripts/cron
+	sudo rsync -a /opt/Gooby/scripts/bin/gooby /bin
+	sudo chmod 755 /bin/gooby
+fi
 
 source /opt/Gooby/menus/variables.sh