diff --git a/opnsense-carp-dhcp-master.php b/opnsense-carp-dhcp-master.php index 9da5ea2..b1bf2f0 100644 --- a/opnsense-carp-dhcp-master.php +++ b/opnsense-carp-dhcp-master.php @@ -179,7 +179,7 @@ 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) { +do { exec("ping -c 4 " . $syncIP, $output, $result); if ($result == 0) { printf("Ping is successful. \n"); @@ -187,7 +187,7 @@ while (true) { } else { printf("Ping unsuccessful. \n"); } -} +} while (true) printf("Sleeping for 30 seconds. \n"); sleep(30);