Now stops and starts under package control.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@317 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2003-01-14 13:07:57 +00:00
parent 67d01d678d
commit 91042fef25
2 changed files with 9 additions and 21 deletions

View File

@ -84,6 +84,13 @@ function fixDevices()
exec( $string );
}
function packageControl( $command )
{
$string = ZM_PATH."/zmpkg.pl $command";
$string .= " 2>/dev/null >&- <&- >/dev/null";
exec( $string );
}
function daemonControl( $command, $daemon=false, $args=false )
{
$string = ZM_PATH."/zmdc.pl $command";

View File

@ -50,12 +50,11 @@ switch( $view )
if ( $stop )
{
daemonControl( 'shutdown' );
packageControl( 'stop' );
}
if ( $start )
{
fixDevices();
packageControl( 'start' );
}
header("Refresh: ".(($start||$stop)?1:REFRESH_MAIN)."; URL='$PHP_SELF'" );
@ -88,12 +87,6 @@ switch( $view )
$cycle_count = 0;
while( $row = mysql_fetch_assoc( $result ) )
{
if ( $start )
{
zmcControl( $row );
zmaControl( $row );
daemonControl( 'start', 'zmfilter.pl', "-m $row[Id] -e -1" );
}
$row['zma'] = zmaCheck( $row );
if ( $max_width < $row[Width] ) $max_width = $row[Width];
if ( $max_height < $row[Height] ) $max_height = $row[Height];
@ -108,18 +101,6 @@ switch( $view )
$cycle_count++;
}
}
if ( $start )
{
if ( ZM_OPT_FAST_DELETE )
{
daemonControl( 'start', 'zmaudit.pl', '-d 900 -y' );
}
if ( ZM_OPT_X10 )
{
daemonControl( 'start', 'zmx10.pl', '-c start' );
}
daemonControl( 'start', 'zmwatch.pl' );
}
?>
<html>
<head>