Only delete a interface IP if it exists.

This commit is contained in:
Scott Ullrich 2008-02-19 07:00:01 +00:00
parent 39e0413321
commit 18d8c406cd

View File

@ -1586,9 +1586,10 @@ Would you like to remove the IP LAN address and
unload the interface now? [y|n]?
EODD;
if (strcasecmp(chop(fgets($fp)), "y") == 0)
mwexec("/sbin/ifconfig delete " . $config['interfaces']['lan']);
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
if($config['interfaces']['lan']['if'])
mwexec("/sbin/ifconfig delete " . $config['interfaces']['lan']['if']);
}
unset($config['interfaces']['lan']);
unset($config['dhcpd']['lan']);
unset($config['interfaces']['lan']['if']);