wlan2eth/bridge/get-dhcp-dns.sh

10 lines
394 B
Bash
Raw Normal View History

2023-06-13 14:14:38 -06:00
get_dns_servers() {
local interface="$1"
resolvectl status | awk -v iface="Link [0-9]+ \\($interface\\)" '$0 ~ iface {flag=1; next} flag && /DNS Servers/ {gsub(",", ""); print; exit}' | awk -F ': ' '{print $2}'
}
get_dns_domain() {
local interface="$1"
resolvectl status | awk -v iface="Link [0-9]+ \\($interface\\)" '$0 ~ iface {flag=1; next} flag && /DNS Domain/ {print $3; exit}'
}