Commit 13e50b8f authored by Ad Schellevis's avatar Ad Schellevis

(legacy) cleanup rc.interfaces_wan_configure

parent 2a3a6a1d
......@@ -339,7 +339,11 @@ function is_ipaddrv6($ipaddr) {
$tmpip = explode("%", $ipaddr);
$ipaddr = $tmpip[0];
}
return Net_IPv6::checkIPv6($ipaddr);
if (strpos($ipaddr, ":") === false) {
return false;
} else {
return Net_IPv6::checkIPv6($ipaddr);
}
}
/* returns true if $ipaddr is a valid dotted IPv4 address */
......
......@@ -31,10 +31,11 @@ require_once("config.inc");
require_once("functions.inc");
require_once("filter.inc");
$argument = str_replace("\n", "", $argv[1]);
if (empty($argument))
interface_configure("wan");
else {
if (!empty($config['interfaces'][$argument]))
if (!empty($argv[1])) {
$argument = str_replace("\n", "", $argv[1]);
if (!empty($config['interfaces'][$argument])) {
interface_configure($argument);
}
} else {
interface_configure("wan");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment