1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/adguardhome_ynh.git synced 2024-09-03 18:06:23 +02:00

put back the comment note about echo & add comment

This commit is contained in:
OniriCorpe 2023-12-27 22:41:08 +01:00
parent b95d192aa6
commit fdc0d03874

View file

@ -11,6 +11,8 @@
configure_network_interface_dnsmasq(){ configure_network_interface_dnsmasq(){
# used to put the network interface in a dedicated dnsmasq config # 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) 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) ipv6_interface=$(echo "$(ip -6 route get ::1.2.3.4 2> /dev/null)" | head -n1 | grep -oP '(?<=dev )\w+' || true)