File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 2222# ==========================================================================
2323
2424use strict;
25+ use warnings;
2526
2627@EXTRA_PERL_LIB@
2728use ZoneMinder;
@@ -100,7 +101,7 @@ if ($options{command}) {
100101 Error("Unable to connect to zmcontrol server at $sock_file");
101102 }
102103} else {
103- # The server isn't there
104+ # We are the server
104105 require ZoneMinder::Monitor;
105106
106107 my $monitor = ZoneMinder::Monitor->find_one(Id=>$id);
@@ -124,21 +125,14 @@ if ($options{command}) {
124125 $SIG{TERM} = \&TermHandler;
125126 $SIG{INT} = \&TermHandler;
126127
127- Info("Control server $id/$protocol starting at "
128- .strftime('%y/%m/%d %H:%M:%S', localtime())
129- );
128+ Info("Control server $id/$protocol starting at " .strftime('%y/%m/%d %H:%M:%S', localtime()));
130129
131130 $0 = $0.' --id '.$id;
132131
133132 my $control_key = $control->getKey();
134133 $control->loadMonitor();
135-
136- $control->open();
137-
138- # If we have a command when starting up, then do it.
139- if ($options{command}) {
140- my $command = $options{command};
141- $control->$command(\%options);
134+ if (!$control->open()) {
135+ Warning("Failed to open control");
142136 }
143137
144138 socket(SERVER, PF_UNIX, SOCK_STREAM, 0) or Fatal("Can't open socket: $!");
You can’t perform that action at this time.
0 commit comments