Detaint BASH_ENV, increment reload_count, fixed zma start commands and
make dprint always do print, not only if not connected. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@228 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
e5b36ce0a7
commit
e9d3b6b057
|
@ -164,6 +164,7 @@ sub runServer
|
||||||
listen( SERVER, SOMAXCONN ) or die( "Can't listen: $!" );
|
listen( SERVER, SOMAXCONN ) or die( "Can't listen: $!" );
|
||||||
|
|
||||||
( $ENV{PATH} ) = ( $ENV{PATH} =~ /^(.*)$/ );
|
( $ENV{PATH} ) = ( $ENV{PATH} =~ /^(.*)$/ );
|
||||||
|
( $ENV{BASH_ENV} ) = ( $ENV{BASH_ENV} =~ /^(.*)$/ );
|
||||||
|
|
||||||
$dbh = DBI->connect( "DBI:mysql:".main::DB_NAME, main::DB_USER, main::DB_PASS );
|
$dbh = DBI->connect( "DBI:mysql:".main::DB_NAME, main::DB_USER, main::DB_PASS );
|
||||||
|
|
||||||
|
@ -258,6 +259,7 @@ sub runServer
|
||||||
{
|
{
|
||||||
$device->{status} = uc($command);
|
$device->{status} = uc($command);
|
||||||
dprint( $device->{appliance}->address()." $command, ok\n" );
|
dprint( $device->{appliance}->address()." $command, ok\n" );
|
||||||
|
#x10listen( new X10::Event( sprintf("%s %s", $device->{appliance}->address, uc($command) ) ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -330,7 +332,7 @@ sub runServer
|
||||||
}
|
}
|
||||||
delete( $pending_tasks{$activation_time} );
|
delete( $pending_tasks{$activation_time} );
|
||||||
}
|
}
|
||||||
if ( $reload || $reload_count >= $reload_limit )
|
if ( $reload || ++$reload_count >= $reload_limit )
|
||||||
{
|
{
|
||||||
loadTasks();
|
loadTasks();
|
||||||
$reload = undef;
|
$reload = undef;
|
||||||
|
@ -571,7 +573,7 @@ sub processTask
|
||||||
{
|
{
|
||||||
if ( $instruction eq "start" )
|
if ( $instruction eq "start" )
|
||||||
{
|
{
|
||||||
$command = main::COMMAND_PATH."zmdc.pl start zma ".$task->{monitor};
|
$command = main::COMMAND_PATH."zmdc.pl start zma -m ".$task->{monitor};
|
||||||
if ( $task->{limit} )
|
if ( $task->{limit} )
|
||||||
{
|
{
|
||||||
addPendingTask( $task );
|
addPendingTask( $task );
|
||||||
|
@ -579,7 +581,7 @@ sub processTask
|
||||||
}
|
}
|
||||||
elsif( $instruction eq "stop" )
|
elsif( $instruction eq "stop" )
|
||||||
{
|
{
|
||||||
$command = main::COMMAND_PATH."zmdc.pl stop zma ".$task->{monitor};
|
$command = main::COMMAND_PATH."zmdc.pl stop zma -m ".$task->{monitor};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif( $class eq "alarm" )
|
elsif( $class eq "alarm" )
|
||||||
|
@ -626,10 +628,7 @@ sub dprint
|
||||||
{
|
{
|
||||||
print CLIENT @_
|
print CLIENT @_
|
||||||
}
|
}
|
||||||
else
|
print @_;
|
||||||
{
|
|
||||||
print @_;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub x10listen
|
sub x10listen
|
||||||
|
|
Loading…
Reference in New Issue