moved the logic around to only sync when master node

This commit is contained in:
2021-12-04 16:32:44 -05:00
parent 3ae1d9f4a6
commit a9de0535ab

View File

@@ -308,11 +308,9 @@ if ($carpStatus == "MASTER") {
write_config_and_restart_services($wanInterface);
echo_write_log("Done Setting WAN to Static based on the DHCP information");
} else {
echo_write_log("Router is not currently CARP master, not updating");
}
echo_write_log("Testing to see if this router is the HA sync master");
if (filter_var($config['hasync']['synchronizetoip'], FILTER_VALIDATE_IP)) {
echo_write_log("Testing to see if this router is the HA sync master");
if (filter_var($config['hasync']['synchronizetoip'], FILTER_VALIDATE_IP)) {
echo_write_log("Sleeping for 30 seconds");
sleep(30);
@@ -334,7 +332,10 @@ if (filter_var($config['hasync']['synchronizetoip'], FILTER_VALIDATE_IP)) {
echo_write_log("CARP Sync Status: " . $output);
echo_write_log("finished the CARP Sync");
} else {
} else {
echo_write_log("Router is not the HA sync master");
}
}
} else {
echo_write_log("Router is not currently CARP master, not updating");
echo_write_log("End of Script " . $argv[0]);