From 3a9b39b842086799b2fb3b3a6ff959f33a5088fd Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 15 Oct 2016 21:12:13 +0100 Subject: [PATCH] adjust text in update_dialogs() whiptail --- automated install/basic-install.sh | 39 +++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9e9a7367..a5de9863 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -42,7 +42,7 @@ c=$(( columns / 2 )) ######## Undocumented Flags. Shhh ######## skipSpaceCheck=false -skipRepoUpdate=false +reconfigure=false runUnattended=false ######## FIRST CHECK ######## @@ -864,13 +864,25 @@ View the web interface at http://pi.hole/admin or http://${IPv4_address%/*}/admi } update_dialogs(){ + # reconfigure + if [ "$reconfigure" = true ]; then + opt1a="Refresh" + opt1b="Refresh will retain existing settings" + strAdd="You will remain on the same version" + else + opt1a="Update" + opt1b="Update will retain existing settings." + strAdd="You will be updated to the latest version." + fi + opt2a="Reconfigure" + opt2b="Reconfigure will allow you to enter new settings" - UpdateCmd=$(whiptail --title "Existing Install Detected!" --menu "\n\nWe have detected an existing install.\n\nPlease choose from the following options:" ${r} ${c} 2 \ - "Update" "Update install will retain existing settings." \ - "Install" "Install will allow you to enter new settings." 3>&2 2>&1 1>&3) + UpdateCmd=$(whiptail --title "Existing Install Detected!" --menu "\n\nWe have detected an existing install.\n\nPlease choose from the following options: \n($strAdd)" ${r} ${c} 2 \ + "$opt1a" "$opt1b" \ + "$opt2a" "$opt2b" 3>&2 2>&1 1>&3) - if [[ $? = 0 ]];then - case ${UpdateCmd} in + if [[ $? = 0 ]];then + case ${UpdateCmd} in Update) echo "::: Updating existing install" . ${setupVars} @@ -880,21 +892,20 @@ update_dialogs(){ echo "::: Running complete install script" useUpdateVars=false ;; - esac - else - echo "::: Cancel selected. Exiting..." - exit 1 - fi + esac + else + echo "::: Cancel selected. Exiting..." + exit 1 + fi } main() { - # Check arguments for the undocumented flags for var in "$@" do case "$var" in - "--reconfigure" ) skipRepoUpdate=true;; + "--reconfigure" ) reconfigure=true;; "--i_do_not_follow_recommendations" ) skipSpaceCheck=false;; "--unattended" ) runUnattended=true;; esac @@ -929,7 +940,7 @@ install_dependent_packages INSTALLER_DEPS[@] # Install packages used by the Pi-hole install_dependent_packages PIHOLE_DEPS[@] -if [[ "$skipRepoUpdate" = true ]]; then +if [[ "$reconfigure" = true ]]; then echo "::: --reconfigure passed to install script. Not downloading/updating local repos" else # Get Git files for Core and Admin