summaryrefslogtreecommitdiffstats
path: root/etc/rc.initial.setlanip
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2014-12-02 11:33:21 +0100
committerErmal LUÇI <eri@pfsense.org>2014-12-02 11:33:21 +0100
commit9ea554ee5cb25ea3bf5bb6bf7997c6c7379ce349 (patch)
treec87cb456a89654963038fa310d61362369610093 /etc/rc.initial.setlanip
parent8ad1ee636afe18a52b717db6b7112b26b7ebeed9 (diff)
downloadpfsense-9ea554ee5cb25ea3bf5bb6bf7997c6c7379ce349.zip
pfsense-9ea554ee5cb25ea3bf5bb6bf7997c6c7379ce349.tar.gz
Remove exit from as much as possible backend code
Diffstat (limited to 'etc/rc.initial.setlanip')
-rwxr-xr-xetc/rc.initial.setlanip18
1 files changed, 10 insertions, 8 deletions
diff --git a/etc/rc.initial.setlanip b/etc/rc.initial.setlanip
index e86484a..dd44afc 100755
--- a/etc/rc.initial.setlanip
+++ b/etc/rc.initial.setlanip
@@ -38,7 +38,7 @@ if (isset($options["h"]) || isset($options["help"])) {
echo "usage: /etc/rc.initial.setlanip [option ...]\n";
echo " -h, --help show this message\n";
echo " -n, --dry-run do not make any configuration changes\n";
- exit(0);
+ return 0;
}
$dry_run = isset($options["n"]) || isset($options["dry-run"]);
@@ -146,9 +146,9 @@ if ($count > 1) {
}
if($intnum < 1)
- exit;
+ return;
if($intnum > $count)
- exit;
+ return;
$index = 1;
foreach ($ifdescrs as $ifname => $ifdesc) {
@@ -161,7 +161,7 @@ foreach ($ifdescrs as $ifname => $ifdesc) {
}
if(!$interface) {
echo "Invalid interface!\n";
- exit;
+ return;
}
$ifaceassigned = "";
@@ -365,7 +365,7 @@ function console_configure_dhcpd($version = 4) {
$dhcpstartip = chop(fgets($fp));
if ($dhcpstartip === "") {
fclose($fp);
- exit(0);
+ return 0;
}
$is_ipaddr = ($version === 6) ? is_ipaddrv6($dhcpstartip) : is_ipaddrv4($dhcpstartip);
$is_inrange = is_inrange($dhcpstartip, $subnet_start, $subnet_end);
@@ -378,7 +378,7 @@ function console_configure_dhcpd($version = 4) {
$dhcpendip = chop(fgets($fp));
if ($dhcpendip === "") {
fclose($fp);
- exit(0);
+ return 0;
}
$is_ipaddr = ($version === 6) ? is_ipaddrv6($dhcpendip) : is_ipaddrv4($dhcpendip);
$is_inrange = is_inrange($dhcpendip, $subnet_start, $subnet_end);
@@ -403,8 +403,10 @@ function console_configure_dhcpd($version = 4) {
}
}
-console_configure_dhcpd(4);
-console_configure_dhcpd(6);
+if (console_configure_dhcpd(4) == 0)
+ return;
+if (console_configure_dhcpd(6) == 0)
+ return;
//*****************************************************************************
OpenPOWER on IntegriCloud