summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-03-02 16:37:58 -0300
committerRenato Botelho <renato@netgate.com>2017-03-02 16:37:58 -0300
commit4485ad3189a2a9e295d088c63561e45f66da20d2 (patch)
tree7a18fc0aa133d4f0c55dfdc553618fb44d837b23 /src/etc
parent166c38b288f9ac17f1be128dd26f600aaa4c438f (diff)
parent7038116e2e84872ca118a0630a1af3185e4037f1 (diff)
downloadpfsense-4485ad3189a2a9e295d088c63561e45f66da20d2.zip
pfsense-4485ad3189a2a9e295d088c63561e45f66da20d2.tar.gz
Merge pull request #3578 from NOYB/Vendor_MAC_Retention_-_Update
Diffstat (limited to 'src/etc')
-rwxr-xr-xsrc/etc/rc.bootup8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup
index ea0d91a..f33b434 100755
--- a/src/etc/rc.bootup
+++ b/src/etc/rc.bootup
@@ -113,7 +113,6 @@ echo "done.\n";
if (mwexec("/bin/kenv -q pfSense.boot 2>/dev/null") != 0) {
/* Collect vendor MAC address for all interfaces */
$ifs = pfSense_interface_listget();
- unlink_if_exists("{$g['vardb_path']}/vendor_mac");
foreach ($ifs as $if) {
$if_details = pfSense_get_interface_addresses($if);
if (isset($if_details['iftype']) &&
@@ -128,8 +127,11 @@ if (mwexec("/bin/kenv -q pfSense.boot 2>/dev/null") != 0) {
$vendor_mac_arr[$if] = $if_details['macaddr'];
}
- @file_put_contents("{$g['vardb_path']}/vendor_mac", json_encode($vendor_mac_arr));
- unset($ifs, $if, $vendor_mac_arr);
+ $vendor_mac_arr_json = json_encode($vendor_mac_arr);
+ if (@file_get_contents("{$g['vardb_path']}/vendor_mac") !== $vendor_mac_arr_json) {
+ @file_put_contents("{$g['vardb_path']}/vendor_mac", $vendor_mac_arr_json);
+ }
+ unset($ifs, $if, $vendor_mac_arr, $vendor_mac_arr_json);
mwexec("/bin/kenv pfSense.boot=1");
}
OpenPOWER on IntegriCloud