From 99c2a28b1d70fe34be2c435977e4afb491618ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Sun, 30 Nov 2008 20:15:08 +0000 Subject: Add some checks on interface_bring_down and remove unlinking of nameserver.conf it needs some more thinking on how to propperly do that. --- etc/inc/interfaces.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 9d4bdcd..163b14b 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -581,6 +581,9 @@ function interface_reconfigure($interface = "wan") { function interface_bring_down($interface = "wan") { global $config, $g; + if (!isset($config['interfaces'][$interface])) + return; + $ifcfg = $config['interfaces'][$interface]; $realif = get_real_interface($interface); @@ -590,7 +593,7 @@ function interface_bring_down($interface = "wan") { /* remove interface up file if it exists */ unlink_if_exists("{$g['tmp_path']}/{$interface}up"); unlink_if_exists("{$g['vardb_path']}/{$interface}ip"); - unlink_if_exists("{$g['varetc_path']}/nameservers.conf"); + //unlink_if_exists("{$g['varetc_path']}/nameservers.conf"); switch ($ifcfg['ipaddr']) { case "pppoe": -- cgit v1.1