lookup IPv4 address only when IPv6 address has changed
This commit is contained in:
parent
ab35869ef6
commit
e2324e8093
|
@ -157,10 +157,10 @@ function main {
|
||||||
ip -6 -o monitor address dev $(get_interface) |
|
ip -6 -o monitor address dev $(get_interface) |
|
||||||
while IFS= read -r line
|
while IFS= read -r line
|
||||||
do
|
do
|
||||||
ip4=$(lookup_ip4 "$(declare -p config)")
|
|
||||||
local new_ip6=$(parse_ip_monitor_output "${line}")
|
local new_ip6=$(parse_ip_monitor_output "${line}")
|
||||||
#echo "ip-monitor output was ${line}"
|
#echo "ip-monitor output was ${line}"
|
||||||
if [ -n "${new_ip6}" ] && [ "${new_ip6}" != "${ip6}" ]; then
|
if [ -n "${new_ip6}" ] && [ "${new_ip6}" != "${ip6}" ]; then
|
||||||
|
ip4=$(lookup_ip4 "$(declare -p config)")
|
||||||
ip6=$new_ip6
|
ip6=$new_ip6
|
||||||
update "${ip4}" "${ip6}" "$(declare -p config)"
|
update "${ip4}" "${ip6}" "$(declare -p config)"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue