We could revist this again in future if we decide that there should still be a choice to install the interface or not
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
# Give settings their default values. These may be changed by prompts later in the script.
QUERY_LOGGING=true
INSTALL_WEB_INTERFACE=true
WEBPORT=8080
PRIVACY_LEVEL=0
CACHE_SIZE=10000
@ -1048,44 +1047,6 @@ setPrivacyLevel() {
esac
}
# Function to ask the user if they want to install the dashboard
setAdminFlag(){
# Similar to the logging function, ask what the user wants
dialog --no-shadow --keep-tite \
--backtitle "Pihole Installation"\
--title "Admin Web Interface"\
--yesno "\\n\\nDo you want to install the Admin Web Interface?"\
"${r}""${c}"&&result=0||result=$?
case${result} in
"${DIALOG_OK}")
# If they chose yes,
printf" %b Installing Admin Web Interface\\n""${INFO}"
# Set the flag to install the web interface
INSTALL_WEB_INTERFACE=true
# Web port TODO: Below whiptail copy pasted from a previous go at this. needs converting to dialog
# Ask for the IPv4 address
WEBPORT=$(whiptail --backtitle "Setting web interface port" --title "Web Port" --inputbox "By default, pihole-FTL listens for http traffic on port 8080. If you wish to change the port, you may do so now. You can also do it later by editing /etc/pihole/pihole-FTL.conf""${r}""${c}""${WEBPORT}" 3>&1 1>&2 2>&3)||\
# Canceling IPv4 settings window
{echo -e "${COL_LIGHT_RED}Cancel was selected, exiting installer${COL_NC}";exit 1;}
printf" %b The Web interface will be accessible on port: %s\\n""${INFO}""${WEBPORT}"
;;
"${DIALOG_CANCEL}")
# If they chose no,
printf" %b Not installing Admin Web Interface\\n""${INFO}"
# Set the flag to not install the web interface
INSTALL_WEB_INTERFACE=false
;;
"${DIALOG_ESC}")
# User pressed <ESC>
printf" %b Escape pressed, exiting installer at Admin Web Interface choice.%b\\n""${COL_LIGHT_RED}""${COL_NC}"
exit1
;;
esac
}
# A function to display a list of example blocklists for users to select
chooseBlocklists(){
# Back up any existing adlist file, on the off chance that it exists. Useful in case of a reconfigure.
# Else, inform the user that there is no set password.
pwstring="NOT SET"
fi
# If the user wants to install the dashboard,
if[["${INSTALL_WEB_INTERFACE}"==true]];then
# Store a message in a variable and display it
additional="View the web interface at http://pi.hole/admin:${WEBPORT} or http://${IPV4_ADDRESS%/*}:${WEBPORT}/admin\\n\\nYour Admin Webpage login password is ${pwstring}"
fi
# Store a message in a variable and display it
additional="View the web interface at http://pi.hole/admin:${WEBPORT} or http://${IPV4_ADDRESS%/*}:${WEBPORT}/admin\\n\\nYour Admin Webpage login password is ${pwstring}"
# Final completion message to user
dialog --no-shadow --keep-tite \
@ -1928,14 +1887,11 @@ clone_or_update_repos() {
{printf" %b Unable to reset %s, exiting installer%b\\n""${COL_LIGHT_RED}""${PI_HOLE_LOCAL_REPO}""${COL_NC}";\
exit 1;\
}
# If the Web interface was installed,
if[["${INSTALL_WEB_INTERFACE}"==true]];then
# reset it's repo
resetRepo ${webInterfaceDir}||\
{printf" %b Unable to reset %s, exiting installer%b\\n""${COL_LIGHT_RED}""${webInterfaceDir}""${COL_NC}";\
exit 1;\
}
fi
# Reset the Web repo
resetRepo ${webInterfaceDir}||\
{printf" %b Unable to reset %s, exiting installer%b\\n""${COL_LIGHT_RED}""${webInterfaceDir}""${COL_NC}";\
exit 1;\
}
# Otherwise, a repair is happening
else
# so get git files for Core
@ -1943,14 +1899,11 @@ clone_or_update_repos() {
{printf" %b Unable to clone %s into %s, unable to continue%b\\n""${COL_LIGHT_RED}""${piholeGitUrl}""${PI_HOLE_LOCAL_REPO}""${COL_NC}";\