From 2ef87ad110f849dce59a3f3dd336fb35e459ce5b Mon Sep 17 00:00:00 2001 From: WaLLy3K Date: Mon, 22 May 2017 06:47:26 +1000 Subject: [PATCH] Retrieve local repos on repair (#1481) * Retrieve local repos on repair * Change conditional to check for repair * Change wording of Update/Reconfigure message * Fixed indenting * Perform "git reset --hard" on reconfigure --- automated install/basic-install.sh | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index a2aff252..5d893067 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1180,22 +1180,23 @@ update_dialogs() { } clone_or_update_repos() { -if [[ "${reconfigure}" == true ]]; then - echo "::: --reconfigure passed to install script. Not downloading/updating local repos" - else - # Get Git files for Core and Admin - getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl} || \ - { echo "!!! Unable to clone ${piholeGitUrl} into ${PI_HOLE_LOCAL_REPO}, unable to continue."; \ - exit 1; \ - } - - if [[ ${INSTALL_WEB} == true ]]; then - getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \ - { echo "!!! Unable to clone ${webInterfaceGitUrl} into ${webInterfaceDir}, unable to continue."; \ - exit 1; \ - } - fi + if [[ "${reconfigure}" == true ]]; then + echo "::: --reconfigure passed to install script. Resetting changes to local repos" + git reset --hard + else + # Get Git files for Core and Admin + getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl} || \ + { echo "!!! Unable to clone ${piholeGitUrl} into ${PI_HOLE_LOCAL_REPO}, unable to continue."; \ + exit 1; \ + } + + if [[ ${INSTALL_WEB} == true ]]; then + getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \ + { echo "!!! Unable to clone ${webInterfaceGitUrl} into ${webInterfaceDir}, unable to continue."; \ + exit 1; \ + } fi + fi } FTLinstall() {