summaryrefslogtreecommitdiffstats
path: root/etc/rc.newwanip
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc.newwanip')
-rwxr-xr-xetc/rc.newwanip17
1 files changed, 14 insertions, 3 deletions
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index 4735994..b85d102 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -84,7 +84,6 @@ system_resolvconf_generate(true);
/* write current WAN IP to file */
file_put_contents("{$g['vardb_path']}/{$interface}_ip", $curwanip);
-file_put_contents("{$g['vardb_path']}/{$interface}_cacheip", $curwanip);
/* reconfigure static routes (kernel may have deleted them) */
system_routing_configure($interface);
@@ -95,8 +94,19 @@ setup_gateways_monitor();
/* signal filter reload */
filter_configure();
-if (is_ipaddr($oldip) && $curwanip == $oldip)
+if (is_ipaddr($oldip) && $curwanip == $oldip) {
+ // Still need to sync VPNs on PPPoE and such, as even with the same IP the VPN software is unhappy with the IP disappearing.
+ if (in_array($config['interfaces'][$interface]['ipaddr'], array('pppoe', 'pptp', 'ppp'))) {
+ /* reconfigure IPsec tunnels */
+ vpn_ipsec_force_reload();
+
+ /* start OpenVPN server & clients */
+ openvpn_resync_all($interface);
+ }
exit;
+}
+
+file_put_contents("{$g['vardb_path']}/{$interface}_cacheip", $curwanip);
/* perform RFC 2136 DNS update */
services_dnsupdate_process($interface);
@@ -108,7 +118,8 @@ services_dyndns_configure($interface);
vpn_ipsec_force_reload();
/* start OpenVPN server & clients */
-openvpn_resync_all($interface);
+if (substr($interface_real, 0, 4) != "ovpn")
+ openvpn_resync_all($interface);
/* reload graphing functions */
enable_rrd_graphing();
OpenPOWER on IntegriCloud