From 6130b800e3e02ba3f8a4c7997fc67861f0efdb6e Mon Sep 17 00:00:00 2001 From: deHakkelaar Date: Mon, 2 Jun 2025 03:59:36 +0200 Subject: [PATCH 1/2] basic-install.sh listing interfaces Following up on below one: https://github.com/pi-hole/pi-hole/pull/6236 And below poor attempt: https://github.com/pi-hole/pi-hole/pull/6256 Signed-off-by: deHakkelaar --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 279dc1d1..dfecda9c 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -577,7 +577,7 @@ Do you wish to continue with an IPv6-only installation?\\n\\n" \ # Get available interfaces that are UP get_available_interfaces() { # There may be more than one so it's all stored in a variable - availableInterfaces=$(ip --oneline link show up | awk '{print $2}' | grep -v "^lo" | cut -d':' -f1 | cut -d'@' -f1) + availableInterfaces=$(ip --oneline link show up | awk -F ': |@' '!/<.*LOOPBACK.*>/ {print $2}') } # A function for displaying the dialogs the user sees when first running the installer From 86bdae0076edf3a96a41ade11bc0675fa988e45a Mon Sep 17 00:00:00 2001 From: deHakkelaar Date: Sun, 13 Jul 2025 11:05:58 +0200 Subject: [PATCH 2/2] Update basic-install.sh Added comments --- automated install/basic-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index dfecda9c..3932fb59 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -577,6 +577,9 @@ Do you wish to continue with an IPv6-only installation?\\n\\n" \ # Get available interfaces that are UP get_available_interfaces() { # There may be more than one so it's all stored in a variable + # The ip command list all interfaces that are in the up state + # The awk command filters out any interfaces that have the LOOPBACK flag set + # while using the characters ": " or "@" as a field separator for awk availableInterfaces=$(ip --oneline link show up | awk -F ': |@' '!/<.*LOOPBACK.*>/ {print $2}') }