added logic to wait for backup host to come back online before trying carp sync
This commit is contained in:
@@ -182,6 +182,16 @@ sleep(30);
|
|||||||
|
|
||||||
# try to sync carp settings to backup node/router
|
# try to sync carp settings to backup node/router
|
||||||
printf("Starting the CARP Sync. \n");
|
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'));
|
$syncStatus = trim(shell_exec('configctl system ha_reconfigure_backup'));
|
||||||
printf("CARP Sync Status: %s. \n", $syncStatus);
|
printf("CARP Sync Status: %s. \n", $syncStatus);
|
||||||
printf("finished the CARP Sync. \n");
|
printf("finished the CARP Sync. \n");
|
||||||
|
|||||||
Reference in New Issue
Block a user