diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-03-14 14:08:38 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-03-14 14:08:38 -0300 |
commit | d632dd5aa9f4809e187475c367f3f1eaf444d8c3 (patch) | |
tree | 43413f14a4bb3050a7ec137385ebaaeead487877 /etc/rc.initial.setlanip | |
parent | 08e9c732d05b38c9cdcd826ac6a22ff99c155993 (diff) | |
download | pfsense-d632dd5aa9f4809e187475c367f3f1eaf444d8c3.zip pfsense-d632dd5aa9f4809e187475c367f3f1eaf444d8c3.tar.gz |
Check if IP is already configured on console setup
Diffstat (limited to 'etc/rc.initial.setlanip')
-rwxr-xr-x | etc/rc.initial.setlanip | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/rc.initial.setlanip b/etc/rc.initial.setlanip index 5b60132..14213b5 100755 --- a/etc/rc.initial.setlanip +++ b/etc/rc.initial.setlanip @@ -258,7 +258,12 @@ function console_configure_ip_address($version) { $upperifname, $label_IPvX) . "\n> "; $intip = chop(fgets($fp)); $is_ipaddr = ($version === 6) ? is_ipaddrv6($intip) : is_ipaddrv4($intip); - } while (!($is_ipaddr || $intip == '')); + if ($is_ipaddr && is_ipaddr_configured($intip, $interface, true)) { + $ip_conflict = true; + echo gettext("This IP address conflicts with another interface or a VIP") . "\n"; + } else + $ip_conflict = false; + } while (($ip_conflict === true) || !($is_ipaddr || $intip == '')); if ($intip != '') { echo "\n" . sprintf(gettext("Subnet masks are entered as bit counts (as in CIDR notation) in %s."), $g['product_name']) . "\n"; |