mirror of
https://github.com/YunoHost-Apps/adguardhome_ynh.git
synced 2024-09-03 18:06:23 +02:00
fix
This commit is contained in:
parent
952f48f41a
commit
7c5ce0d152
1 changed files with 7 additions and 2 deletions
|
@ -14,8 +14,13 @@ get_network_interface(){
|
||||||
local IPvx="$1"
|
local IPvx="$1"
|
||||||
|
|
||||||
# note: echo the IP route command to prevent a crash if the server doesn't have any IPv4/6
|
# note: echo the IP route command to prevent a crash if the server doesn't have any IPv4/6
|
||||||
# shellcheck disable=SC2005
|
if [[ "$IPvx" = "4" ]]; then
|
||||||
echo ipv4_interface="$(echo "$(ip -"$IPvx" route get 1.2.3.4 2> /dev/null)" | head -n1 | grep -oP '(?<=dev )\w+' || true)"
|
# shellcheck disable=SC2005
|
||||||
|
echo "$(echo "$(ip -4 route get 1.2.3.4 2> /dev/null)" | head -n1 | grep -oP '(?<=dev )\w+' || true)"
|
||||||
|
else
|
||||||
|
# shellcheck disable=SC2005
|
||||||
|
echo "$(echo "$(ip -6 route get ::1.2.3.4 2> /dev/null)" | head -n1 | grep -oP '(?<=dev )\w+' || true)"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_network_interface_dnsmasq(){
|
configure_network_interface_dnsmasq(){
|
||||||
|
|
Loading…
Add table
Reference in a new issue