lookup IPv4 address only when IPv6 address has changed

master
lurchi 2019-03-01 18:55:50 +01:00
parent ab35869ef6
commit e2324e8093
1 changed files with 1 additions and 1 deletions

View File

@ -157,10 +157,10 @@ function main {
ip -6 -o monitor address dev $(get_interface) |
while IFS= read -r line
do
ip4=$(lookup_ip4 "$(declare -p config)")
local new_ip6=$(parse_ip_monitor_output "${line}")
#echo "ip-monitor output was ${line}"
if [ -n "${new_ip6}" ] && [ "${new_ip6}" != "${ip6}" ]; then
ip4=$(lookup_ip4 "$(declare -p config)")
ip6=$new_ip6
update "${ip4}" "${ip6}" "$(declare -p config)"
fi