From 34df34ba2759d4addd8f0248b243eb33e8f04e9d Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sat, 14 Jan 2017 20:16:27 -0800 Subject: [PATCH] Actually rm the Pi-hole scripts. Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 7e6572b0..09c58014 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -27,7 +27,7 @@ webInterfaceGitUrl="https://github.com/pi-hole/AdminLTE.git" webInterfaceDir="/var/www/html/admin" piholeGitUrl="https://github.com/pi-hole/pi-hole.git" PI_HOLE_LOCAL_REPO="/etc/.pihole" -PI_HOLE_FILES=(chronometer list piholeDebug piholeLogFlush setupLCD update version) +PI_HOLE_FILES=(chronometer list piholeDebug piholeLogFlush setupLCD update version gravity uninstall webpage) PI_HOLE_INSTALL_DIR="/opt/pihole" useUpdateVars=false @@ -600,10 +600,11 @@ clean_existing() { # Clean an exiting installation to prepare for upgrade/reinstall # ${1} Directory to clean; ${2} Array of files to remove local clean_directory="${1}" - local old_files=${2} + shift + local old_files=( "$@" ) for script in "${old_files[@]}"; do - rm -f "${clean_directory}${script}.sh" + rm -f "${clean_directory}/${script}.sh" done } @@ -614,7 +615,7 @@ installScripts() { echo -n "::: Installing scripts from ${PI_HOLE_LOCAL_REPO}..." # Clear out script files from Pi-hole scripts directory. - clean_existing "${PI_HOLE_INSTALL_DIR}" "${PI_HOLE_FILES}" + clean_existing "${PI_HOLE_INSTALL_DIR}" "${PI_HOLE_FILES[@]}" # Install files from local core repository if is_repo "${PI_HOLE_LOCAL_REPO}"; then