opnsense-patch -a kulikov-a 6dbad67
$ip = get_interface_ip($interface);$cacheip_file = "/tmp/{$device}_oldip";if (!is_ipaddr($ip)) { /* remove previously cached IP since it is gone */ @unlink($cacheip_file); /* * Take care of OpenVPN and similar if you generate the event * to reconfigure an interface. OpenVPN might be in tap(4) * mode and not have an IP address. */ if (substr($device, 0, 4) != 'ovpn') { log_msg("Failed to detect IP for {$interface_descr}[{$interface}]", LOG_WARNING); return; }}
Complaining is easy.
The trouble here is that we can't forever cache the IP, but still want to wait out if the IP actually cycles or how long the disconnect happened. I understand the implications, but from experience the old code also had its pitfalls with forever-caching the previous IP.
Not sure how to proceed. I don't see a possible solution here too within this thread. Complaining is easy.
#/usr/local/bin/bashcurrent_ip=$(ifconfig pppoe2 | grep 'inet' | awk -F ' ' '{ print $2 }')read cached_ip < /opt/cached_ipif [[ $current_ip == $cached_ip ]]; then echo "IPs gleich"elsepfctl -k $cached_ipecho "$current_ip" > /opt/cached_ipecho "States gekillt"fi