Fix Monitor::Control to handle local cameras

This commit is contained in:
Isaac Connor 2021-12-14 15:05:21 -05:00
parent e8edeab641
commit f683557b0e
1 changed files with 14 additions and 8 deletions

View File

@ -241,20 +241,26 @@ sub control {
my $command = shift; my $command = shift;
my $process = shift; my $process = shift;
if ( $command eq 'stop' or $command eq 'restart' ) { if ($command eq 'stop' or $command eq 'restart') {
if ( $process ) { if ($process) {
`/usr/bin/zmdc.pl stop $process -m $$monitor{Id}`; runCommand("zmdc.pl stop $process -m $$monitor{Id}");
} else { } else {
`/usr/bin/zmdc.pl stop zma -m $$monitor{Id}`; if ($monitor->{Type} eq 'Local') {
`/usr/bin/zmdc.pl stop zmc -m $$monitor{Id}`; runCommand('zmdc.pl stop zmc -d '.$monitor->{Device});
} else {
runCommand('zmdc.pl stop zmc -m '.$monitor->{Id});
}
} }
} }
if ( $command eq 'start' or $command eq 'restart' ) { if ( $command eq 'start' or $command eq 'restart' ) {
if ( $process ) { if ( $process ) {
`/usr/bin/zmdc.pl start $process -m $$monitor{Id}`; runCommand("zmdc.pl start $process -m $$monitor{Id}");
} else { } else {
`/usr/bin/zmdc.pl start zmc -m $$monitor{Id}`; if ($monitor->{Type} eq 'Local') {
`/usr/bin/zmdc.pl start zma -m $$monitor{Id}`; runCommand('zmdc.pl stop zmc -d '.$monitor->{Device});
} else {
runCommand('zmdc.pl stop zmc -m '.$monitor->{Id});
}
} # end if } # end if
} }
} # end sub control } # end sub control