Skip to content

Commit

Permalink
Only try to reboot if we can ping. The open can hang a long time, and…
Browse files Browse the repository at this point in the history
… so a rebooting camera can then be told to reboot again, causing an endless cycle
  • Loading branch information
Isaac Connor committed Nov 19, 2024
1 parent 19bd85c commit 566ce16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/zmwatch.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ while (!$zm_terminate) {
Debug("Monitor $monitor->{Id} $monitor->{Name}, startup time $now - $startup_time $startup_elapsed <? $Config{ZM_WATCH_MAX_DELAY}");
if ($monitor->ControlId()) {
my $control = $monitor->Control();
if ($control and $control->CanReboot() and $control->open()) {
if ($control and $control->CanReboot() and $control->ping() and $control->open()) {
$control->reboot();
}
}
Expand Down

0 comments on commit 566ce16

Please sign in to comment.