covnerted while always true loop to a do while loop

This commit is contained in:
2021-12-02 15:15:46 -05:00
parent eb67dc2972
commit 761717f438

View File

@@ -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);