adjust text in update_dialogs() whiptail

pull/790/head
Promofaux 8 years ago
parent e612003293
commit 3a9b39b842

@ -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

Loading…
Cancel
Save