mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-22 05:51:15 +00:00
Minor installer output enhancements
+ Print restart hint after setting IPv4 address on a separate line with [i] prefix to not break text alignment + Print final upstream DNS choice as a single printf call and by this fix missing info and linebreak on "Custom" choices. + Minor if/then/else code alignment Signed-off-by: MichaIng <micha@dietpi.com>
This commit is contained in:
parent
29bad2fe9b
commit
ea67c828cd
@ -838,7 +838,8 @@ setDHCPCD() {
|
|||||||
# Then use the ip command to immediately set the new address
|
# Then use the ip command to immediately set the new address
|
||||||
ip addr replace dev "${PIHOLE_INTERFACE}" "${IPV4_ADDRESS}"
|
ip addr replace dev "${PIHOLE_INTERFACE}" "${IPV4_ADDRESS}"
|
||||||
# Also give a warning that the user may need to reboot their system
|
# 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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -984,8 +985,6 @@ setDNS() {
|
|||||||
# exit if Cancel is selected
|
# exit if Cancel is selected
|
||||||
{ printf " %bCancel was selected, exiting installer%b\\n" "${COL_LIGHT_RED}" "${COL_NC}"; exit 1; }
|
{ 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
|
# Depending on the user's choice, set the GLOBAl variables to the IP of the respective provider
|
||||||
if [[ "${DNSchoices}" == "Custom" ]]
|
if [[ "${DNSchoices}" == "Custom" ]]
|
||||||
then
|
then
|
||||||
@ -1037,14 +1036,14 @@ setDNS() {
|
|||||||
if [[ "${PIHOLE_DNS_2}" == "${strInvalid}" ]]; then
|
if [[ "${PIHOLE_DNS_2}" == "${strInvalid}" ]]; then
|
||||||
PIHOLE_DNS_2=""
|
PIHOLE_DNS_2=""
|
||||||
fi
|
fi
|
||||||
# Since the settings will not work, stay in the loop
|
# Since the settings will not work, stay in the loop
|
||||||
DNSSettingsCorrect=False
|
DNSSettingsCorrect=False
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
else
|
else
|
||||||
# Show the settings
|
# 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
|
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
|
# and break from the loop since the servers are valid
|
||||||
DNSSettingsCorrect=True
|
DNSSettingsCorrect=True
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
else
|
else
|
||||||
# If the settings are wrong, the loop continues
|
# If the settings are wrong, the loop continues
|
||||||
@ -1052,7 +1051,7 @@ setDNS() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
# Save the old Internal Field Separator in a variable
|
# Save the old Internal Field Separator in a variable
|
||||||
OIFS=$IFS
|
OIFS=$IFS
|
||||||
# and set the new one to newline
|
# and set the new one to newline
|
||||||
@ -1062,7 +1061,6 @@ setDNS() {
|
|||||||
DNSName="$(cut -d';' -f1 <<< "${DNSServer}")"
|
DNSName="$(cut -d';' -f1 <<< "${DNSServer}")"
|
||||||
if [[ "${DNSchoices}" == "${DNSName}" ]]
|
if [[ "${DNSchoices}" == "${DNSName}" ]]
|
||||||
then
|
then
|
||||||
printf "%s\\n" "${DNSName}"
|
|
||||||
PIHOLE_DNS_1="$(cut -d';' -f2 <<< "${DNSServer}")"
|
PIHOLE_DNS_1="$(cut -d';' -f2 <<< "${DNSServer}")"
|
||||||
PIHOLE_DNS_2="$(cut -d';' -f3 <<< "${DNSServer}")"
|
PIHOLE_DNS_2="$(cut -d';' -f3 <<< "${DNSServer}")"
|
||||||
break
|
break
|
||||||
@ -1071,6 +1069,9 @@ setDNS() {
|
|||||||
# Restore the IFS to what it was
|
# Restore the IFS to what it was
|
||||||
IFS=${OIFS}
|
IFS=${OIFS}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Display final selection
|
||||||
|
printf " %b Using upstream DNS: %s %s\\n" "${INFO}" "${PIHOLE_DNS_1}" "${PIHOLE_DNS_2}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Allow the user to enable/disable logging
|
# Allow the user to enable/disable logging
|
||||||
|
Loading…
Reference in New Issue
Block a user