From 50b3c3ae7fa2210a4a7bf9d4bf47f1a64ecfea36 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Wed, 6 May 2026 13:10:58 +0200 Subject: [PATCH] fix(adguardhome-sync): replace ifconfig with hostname -I for IP detection (#14273) ifconfig is not available on modern Debian systems (net-tools not installed by default). Replace with hostname -I which is available everywhere, with ip addr as fallback. Fixes: #14257 --- tools/addon/adguardhome-sync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/addon/adguardhome-sync.sh b/tools/addon/adguardhome-sync.sh index 61f3902ae..406c00d5d 100644 --- a/tools/addon/adguardhome-sync.sh +++ b/tools/addon/adguardhome-sync.sh @@ -55,7 +55,7 @@ EOF # HELPER FUNCTIONS # ============================================================================== get_ip() { - ifconfig | grep -v '127.0.0.1' | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -m1 -Eo '([0-9]*\.){3}[0-9]*' || echo "127.0.0.1" + hostname -I 2>/dev/null | awk '{print $1}' || ip -4 addr show scope global 2>/dev/null | awk '/inet / {print $2}' | cut -d/ -f1 | head -n1 || echo "127.0.0.1" } # ==============================================================================