mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-09 15:40:54 +00:00
parent
3f40a95929
commit
332baed4bb
@ -103,6 +103,7 @@ In the next section, you can choose to use your current network settings (DHCP)
|
|||||||
chooseInterface()
|
chooseInterface()
|
||||||
{
|
{
|
||||||
# Turn the available interfaces into an array so it can be used with a whiptail dialog
|
# Turn the available interfaces into an array so it can be used with a whiptail dialog
|
||||||
|
if [[ $chooseInterfaceOptions ]];then
|
||||||
interfacesArray=()
|
interfacesArray=()
|
||||||
firstloop=1
|
firstloop=1
|
||||||
|
|
||||||
@ -115,7 +116,11 @@ if [[ $firstloop -eq 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
interfacesArray+=("$line" "available" "$mode")
|
interfacesArray+=("$line" "available" "$mode")
|
||||||
done <<< "$availableInterfaces"
|
done <<< "$availableInterfaces"
|
||||||
|
else
|
||||||
|
# Exit if user cancels
|
||||||
|
echo "Cancelling installation."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
# Find out how many interfaces are available to choose from
|
# Find out how many interfaces are available to choose from
|
||||||
interfaceCount=$(echo "$availableInterfaces" | wc -l)
|
interfaceCount=$(echo "$availableInterfaces" | wc -l)
|
||||||
chooseInterfaceCmd=(whiptail --separate-output --radiolist "Choose An Interface" $r $c $interfaceCount)
|
chooseInterfaceCmd=(whiptail --separate-output --radiolist "Choose An Interface" $r $c $interfaceCount)
|
||||||
@ -135,6 +140,7 @@ cmd=(whiptail --separate-output --checklist "Select Protocols" $r $c 2)
|
|||||||
options=(IPv4 "Block ads over IPv4" on
|
options=(IPv4 "Block ads over IPv4" on
|
||||||
IPv6 "Block ads over IPv6" off)
|
IPv6 "Block ads over IPv6" off)
|
||||||
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
|
||||||
|
if [[ $choices ]];then
|
||||||
for choice in $choices
|
for choice in $choices
|
||||||
do
|
do
|
||||||
case $choice in
|
case $choice in
|
||||||
@ -142,6 +148,11 @@ do
|
|||||||
IPv6)useIPv6=true;;
|
IPv6)useIPv6=true;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
else
|
||||||
|
# Exit if user cancels
|
||||||
|
echo "Cancelling installation."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
if [ $useIPv4 ] && [ ! $useIPv6 ]; then
|
if [ $useIPv4 ] && [ ! $useIPv6 ]; then
|
||||||
getStaticIPv4Settings
|
getStaticIPv4Settings
|
||||||
setStaticIPv4
|
setStaticIPv4
|
||||||
|
Loading…
Reference in New Issue
Block a user