summaryrefslogtreecommitdiffstats
path: root/etc/rc.newwanip
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-07-14 20:43:59 +0000
committerErmal Luçi <eri@pfsense.org>2008-07-14 20:43:59 +0000
commit67ee1ec5ec2fe7722d0039aa98da72c4f58107f9 (patch)
treeeca381dbf3e8a85aa1083e6c54a59b33a82b040f /etc/rc.newwanip
parentcbdf9821cc0c9cd09d27732aba5e1f293faf9921 (diff)
downloadpfsense-67ee1ec5ec2fe7722d0039aa98da72c4f58107f9.zip
pfsense-67ee1ec5ec2fe7722d0039aa98da72c4f58107f9.tar.gz
* Merge multiple PPPoE/PPTP interfaces from RELENG_1_MULTI_ANYTHING
* Much improved rule generation speed * Many bug fixing in general of the interface handling NOTE: this is only half part of the changes the other half will come after
Diffstat (limited to 'etc/rc.newwanip')
-rwxr-xr-xetc/rc.newwanip26
1 files changed, 9 insertions, 17 deletions
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index db18908..afb21f9 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -42,16 +42,16 @@ $argument = str_replace("\n", "", $argv[1]);
log_error("Informational: rc.newwanip is starting {$argument}.");
-if($argument <> "") {
- $interface = convert_real_interface_to_friendly_interface_name($argument);
- $interface_real = convert_friendly_interface_to_real_interface_name($argument);
- $curwanip = find_interface_ip($interface_real);
- if($curwanip == "")
- $curwanip = get_current_wan_address();
-} else {
+if(empty($argument)) {
$curwanip = get_current_wan_address();
$interface = "wan";
- $interface_real = $config['interfaces']['wan']['if'];
+ $interface_real = get_real_wan_interface();
+} else {
+ $interface = convert_real_interface_to_friendly_interface_name($argument);
+ $interface_real = $argument;
+ $curwanip = find_interface_ip($interface_real);
+ if($curwanip == "")
+ $curwanip = get_current_wan_address($interface);
}
log_error("rc.newwanip working with (IP address: {$curwanip}) (interface: {$interface}) (interface real: {$interface_real}).");
@@ -62,12 +62,6 @@ if($curwanip == "0.0.0.0") {
exit;
}
-/* grab the prior ip for pftpx tests */
-if(file_exists("/tmp/rc.newwanip_oldip")) {
- /* grab hint from dhclient */
- $old_ip = trim(file_get_contents("/tmp/rc.newwanip_oldip", "\r"));
- unlink("/tmp/rc.newwanip_oldip");
-}
/* fallback to rc.newwanip ip if needed */
if(!$old_ip)
if(file_exists("{$g['vardb_path']}/{$interface}_ip"))
@@ -122,10 +116,8 @@ if($old_ip <> "")
if($old_ip <> $curwanip)
exec("/etc/rc.start_packages");
-
/* reconfigure our gateway monitor */
setup_gateways_monitor();
-return true;
-
+return 0;
?>
OpenPOWER on IntegriCloud