summaryrefslogtreecommitdiffstats
path: root/etc/rc.newwanip
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-27 19:51:32 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-27 19:51:32 +0000
commit39b1181175c41fb37f78b1f396158ba91a4387f8 (patch)
tree949c63e476ff8ad7aa699a9266c5a8932e141c81 /etc/rc.newwanip
parent5c88e18746d5835f4e5095c77ff3ca98365771bd (diff)
downloadpfsense-39b1181175c41fb37f78b1f396158ba91a4387f8.zip
pfsense-39b1181175c41fb37f78b1f396158ba91a4387f8.tar.gz
Trim carriage return off of the $old_ip so that the <> comparison works.
This should fix the packages from always being restarted even if the ip was the same.
Diffstat (limited to 'etc/rc.newwanip')
-rwxr-xr-xetc/rc.newwanip4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index e7f6191..12b5051 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -65,13 +65,13 @@ if($curwanip == "0.0.0.0") {
/* grab the prior ip for pftpx tests */
if(file_exists("/tmp/rc.newwanip_oldip")) {
/* grab hint from dhclient */
- $old_ip = file_get_contents("/tmp/rc.newwanip_oldip");
+ $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"))
- $old_ip = file_get_contents("{$g['vardb_path']}/{$interface}_ip");
+ $old_ip = trim(file_get_contents("{$g['vardb_path']}/{$interface}_ip", "\r");
if($old_ip) {
$helpers = exec("/bin/ps awux | grep \"{$old_ip}\" | grep -v \"grep\" | awk '{ print $2 }'");
if($helpers)
OpenPOWER on IntegriCloud