added --force|-f option to force script to run
This commit is contained in:
@@ -38,6 +38,13 @@ $syncIP = $config['hasync']['synchronizetoip'];
|
||||
# Start of Script #
|
||||
###################
|
||||
|
||||
$force = false;
|
||||
if (count($argv) > 1){
|
||||
if ($argv[1] == "--force" or $argv[1] == "-f"){
|
||||
$force = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function write_config_and_restart_services ($interface) {
|
||||
write_config();
|
||||
@@ -55,7 +62,11 @@ printf("Trying to ping sync host, %s. \n", $syncIP);
|
||||
exec("ping -c 4 " . $syncIP, $output, $result);
|
||||
if ($result == 0) {
|
||||
printf("Ping is successful. No need to update. \n");
|
||||
return;
|
||||
if ($force) {
|
||||
printf("Force was passed in, so continuing with script. \n");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user