From 36645d93352f017a2872a0fb543c958121b1eba7 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 3 Apr 2016 18:39:22 +0100 Subject: [PATCH] Add check for existing files in /usr/local/bin left over from previous version, as those scripts are replaced with `pihole ` script. --- automated install/basic-install.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 332b8153..78bf8809 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -488,6 +488,17 @@ installScripts() { $SUDO chmod 755 /usr/local/bin/pihole $SUDO cp /etc/.pihole/advanced/bash-completion/pihole /etc/bash_completion.d/pihole . /etc/bash_completion.d/pihole + + #Tidy up /usr/local/bin directory if installing over previous install. + oldFiles=( gravity chronometer whitelist blacklist piholeLogFlush updateDashboard uninstall setupLCD piholeDebug) + for i in "${oldFiles[@]}" + do + : + if [ -f "/usr/local/bin/$i.sh" ]; then + $SUDO rm /usr/local/bin/$i.sh + fi + done + $SUDO echo " done." }