diff --git a/opnsense-carp-dhcp.php b/opnsense-carp-dhcp.php index fc3a7bb..71f9762 100644 --- a/opnsense-carp-dhcp.php +++ b/opnsense-carp-dhcp.php @@ -182,6 +182,16 @@ sleep(30); # try to sync carp settings to backup node/router printf("Starting the CARP Sync. \n"); +printf("Trying to ping sync host, %s. \n", $syncIP); +while (true) { + exec("ping -c 4 " . $syncIP, $output, $result); + if ($result == 0) { + printf("Ping is successful. \n"); + break; + } else { + printf("Ping unsuccessful. \n"); + } +} $syncStatus = trim(shell_exec('configctl system ha_reconfigure_backup')); printf("CARP Sync Status: %s. \n", $syncStatus); printf("finished the CARP Sync. \n");