# Then use the ip command to immediately set the new address
ip addr replace dev "${PIHOLE_INTERFACE}""${IPV4_ADDRESS}"
# Also give a warning that the user may need to reboot their system
printf" %b Set IP address to %s \\n You may need to restart after the install is complete\\n""${TICK}""${IPV4_ADDRESS%/*}"
printf" %b Set IP address to %s\\n""${TICK}""${IPV4_ADDRESS%/*}"
printf" %b You may need to restart after the install is complete\\n""${INFO}"
fi
}
@ -984,8 +982,6 @@ setDNS() {
# exit if Cancel is selected
{printf" %bCancel was selected, exiting installer%b\\n""${COL_LIGHT_RED}""${COL_NC}";exit 1;}
# Display the selection
printf" %b Using ""${INFO}"
# Depending on the user's choice, set the GLOBAl variables to the IP of the respective provider
if[["${DNSchoices}"=="Custom"]]
then
@ -1037,14 +1033,14 @@ setDNS() {
if[["${PIHOLE_DNS_2}"=="${strInvalid}"]];then
PIHOLE_DNS_2=""
fi
# Since the settings will not work, stay in the loop
DNSSettingsCorrect=False
# Since the settings will not work, stay in the loop
DNSSettingsCorrect=False
# Otherwise,
else
# Show the settings
if(whiptail --backtitle "Specify Upstream DNS Provider(s)" --title "Upstream DNS Provider(s)" --yesno "Are these settings correct?\\n DNS Server 1: $PIHOLE_DNS_1\\n DNS Server 2: ${PIHOLE_DNS_2}""${r}""${c}");then
# and break from the loop since the servers are valid
DNSSettingsCorrect=True
# and break from the loop since the servers are valid
DNSSettingsCorrect=True
# Otherwise,
else
# If the settings are wrong, the loop continues
@ -1052,7 +1048,7 @@ setDNS() {
fi
fi
done
else
else
# Save the old Internal Field Separator in a variable
whiptail --defaultno --title "SELinux Enforcing Detected" --yesno "SELinux is being ENFORCED on your system! \\n\\nPi-hole currently does not support SELinux, but you may still continue with the installation.\\n\\nNote: Web Admin will not be fully functional unless you set your policies correctly\\n\\nContinue installing Pi-hole?""${r}""${c}"||\
#In the next section we check to see if FTL is already installed (in case of pihole -r).
#If the installed version matches the latest version, then check the installed sha1sum of the binary vs the remote sha1sum. If they do not match, then download
printf" %b Checking for existing FTL binary...\\n""${INFO}"
@ -2358,6 +2394,9 @@ FTLcheckUpdate() {
ftlBranch="master"
fi
local binary
binary="${1}"
local remoteSha1
local localSha1
@ -2436,8 +2475,10 @@ FTLcheckUpdate() {
FTLdetect(){
printf"\\n %b FTL Checks...\\n\\n""${INFO}"
if FTLcheckUpdate ;then
FTLinstall ||return1
printf" %b""${2}"
if FTLcheckUpdate "${1}";then
FTLinstall "${1}"||return1
fi
}
@ -2600,8 +2641,15 @@ main() {
fi
# Create the pihole user
create_pihole_user
# Check if FTL is installed - do this early on as FTL is a hard dependency for Pi-hole
if ! FTLdetect;then
local funcOutput
funcOutput=$(get_binary_name)#Store output of get_binary_name here
local binary
binary="pihole-FTL${funcOutput##*pihole-FTL}"#binary name will be the last line of the output of get_binary_name (it always begins with pihole-FTL)
local theRest
theRest="${funcOutput%pihole-FTL*}"# Print the rest of get_binary_name's output to display (cut out from first instance of "pihole-FTL")