1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-01-03 12:40:56 +00:00

adjust text in update_dialogs() whiptail

This commit is contained in:
Promofaux 2016-10-15 21:12:13 +01:00
parent e612003293
commit 3a9b39b842

View File

@ -42,7 +42,7 @@ c=$(( columns / 2 ))
######## Undocumented Flags. Shhh ######## ######## Undocumented Flags. Shhh ########
skipSpaceCheck=false skipSpaceCheck=false
skipRepoUpdate=false reconfigure=false
runUnattended=false runUnattended=false
######## FIRST CHECK ######## ######## FIRST CHECK ########
@ -864,13 +864,25 @@ View the web interface at http://pi.hole/admin or http://${IPv4_address%/*}/admi
} }
update_dialogs(){ 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 \ 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 \
"Update" "Update install will retain existing settings." \ "$opt1a" "$opt1b" \
"Install" "Install will allow you to enter new settings." 3>&2 2>&1 1>&3) "$opt2a" "$opt2b" 3>&2 2>&1 1>&3)
if [[ $? = 0 ]];then if [[ $? = 0 ]];then
case ${UpdateCmd} in case ${UpdateCmd} in
Update) Update)
echo "::: Updating existing install" echo "::: Updating existing install"
. ${setupVars} . ${setupVars}
@ -880,21 +892,20 @@ update_dialogs(){
echo "::: Running complete install script" echo "::: Running complete install script"
useUpdateVars=false useUpdateVars=false
;; ;;
esac esac
else else
echo "::: Cancel selected. Exiting..." echo "::: Cancel selected. Exiting..."
exit 1 exit 1
fi fi
} }
main() { main() {
# Check arguments for the undocumented flags # Check arguments for the undocumented flags
for var in "$@" for var in "$@"
do do
case "$var" in case "$var" in
"--reconfigure" ) skipRepoUpdate=true;; "--reconfigure" ) reconfigure=true;;
"--i_do_not_follow_recommendations" ) skipSpaceCheck=false;; "--i_do_not_follow_recommendations" ) skipSpaceCheck=false;;
"--unattended" ) runUnattended=true;; "--unattended" ) runUnattended=true;;
esac esac
@ -929,7 +940,7 @@ install_dependent_packages INSTALLER_DEPS[@]
# Install packages used by the Pi-hole # Install packages used by the Pi-hole
install_dependent_packages PIHOLE_DEPS[@] install_dependent_packages PIHOLE_DEPS[@]
if [[ "$skipRepoUpdate" = true ]]; then if [[ "$reconfigure" = true ]]; then
echo "::: --reconfigure passed to install script. Not downloading/updating local repos" echo "::: --reconfigure passed to install script. Not downloading/updating local repos"
else else
# Get Git files for Core and Admin # Get Git files for Core and Admin