This commit is contained in:
Isaac Connor 2021-06-14 13:31:05 -04:00
parent 8da5a1d2c9
commit 583c259951
1 changed files with 11 additions and 13 deletions

View File

@ -101,12 +101,10 @@ if ( $options{command} ) {
Error("Unable to connect to zmcontrol server at $sock_file"); Error("Unable to connect to zmcontrol server at $sock_file");
} }
} else { } else {
# The server isn't there # The server isn't there
my $monitor = zmDbGetMonitorAndControl($id); my $monitor = zmDbGetMonitorAndControl($id);
if ( !$monitor ) { Fatal("Unable to load control data for monitor $id") if !$monitor;
Fatal("Unable to load control data for monitor $id");
}
my $protocol = $monitor->{Protocol}; my $protocol = $monitor->{Protocol};
if (!$protocol) { if (!$protocol) {
Fatal('No protocol is set in monitor. Please edit the monitor, edit control type, select the control capability and fill in the Protocol field'); Fatal('No protocol is set in monitor. Please edit the monitor, edit control type, select the control capability and fill in the Protocol field');
@ -134,7 +132,7 @@ if ( $options{command} ) {
Info("Starting control server $id/$protocol"); Info("Starting control server $id/$protocol");
close(CLIENT); close(CLIENT);
if ( ! can_load( modules => { "ZoneMinder::Control::$protocol" => undef } ) ) { if (!can_load(modules => {'ZoneMinder::Control::'.$protocol => undef})) {
Fatal("Can't load ZoneMinder::Control::$protocol\n$Module::Load::Conditional::ERROR"); Fatal("Can't load ZoneMinder::Control::$protocol\n$Module::Load::Conditional::ERROR");
} }