From fdc0d03874097633335aa16de1fa593b615a2e7d Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Wed, 27 Dec 2023 22:41:08 +0100 Subject: [PATCH] put back the comment note about echo & add comment --- scripts/_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 687315f..c00ce42 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -11,6 +11,8 @@ configure_network_interface_dnsmasq(){ # used to put the network interface in a dedicated dnsmasq config + # get the network interface name for IPv4 and IPv6 + # note: echo the IP route command to prevent a crash if the server doesn't have any IPv4/6 ipv4_interface=$(echo "$(ip -4 route get 1.2.3.4 2> /dev/null)" | head -n1 | grep -oP '(?<=dev )\w+' || true) ipv6_interface=$(echo "$(ip -6 route get ::1.2.3.4 2> /dev/null)" | head -n1 | grep -oP '(?<=dev )\w+' || true)