Took all configure stuff out and replaced it with zmconfig tokens.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@335 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
9e3dcb13c8
commit
cf50f90110
|
@ -6,7 +6,8 @@
|
|||
. /etc/rc.d/init.d/functions
|
||||
|
||||
prog=ZoneMinder
|
||||
command="@prefix@/bin/zmpkg.pl"
|
||||
ZM_PATH_BIN="<from zmconfig>"
|
||||
command="$ZM_PATH_BIN/zmpkg.pl"
|
||||
|
||||
start() {
|
||||
echo -n "Starting $prog: "
|
||||
|
|
|
@ -35,16 +35,18 @@
|
|||
# These are the elements you need to edit to suit your installation
|
||||
#
|
||||
# ==========================================================================
|
||||
use constant ZM_PATH_BIN => "<from zmconfig>";
|
||||
use constant ZM_PATH_WEB => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
use constant ZM_DB_SERVER => "<from zmconfig>";
|
||||
use constant ZM_DB_NAME => "<from zmconfig>";
|
||||
use constant ZM_DB_USERA => "<from zmconfig>";
|
||||
use constant ZM_DB_PASSA => "<from zmconfig>";
|
||||
use constant ZM_DIR_IMAGES => "<from zmconfig>";
|
||||
use constant ZM_DIR_EVENTS => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
|
||||
use constant IMAGE_PATH => "@WEB_PREFIX@/".ZM_DIR_IMAGES;
|
||||
use constant EVENT_PATH => "@WEB_PREFIX@/".ZM_DIR_EVENTS;
|
||||
use constant IMAGE_PATH => ZM_PATH_WEB.'/'.ZM_DIR_IMAGES;
|
||||
use constant EVENT_PATH => ZM_PATH_WEB.'/'.ZM_DIR_EVENTS;
|
||||
use constant LOG_FILE => ZM_PATH_LOGS.'/zmaudit.log';
|
||||
use constant VERBOSE => 0; # Whether to output more verbose debug
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@
|
|||
#
|
||||
# ==========================================================================
|
||||
|
||||
use constant ZM_PATH_BIN => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
|
||||
use constant DAEMON_PATH => '@prefix@/bin/';
|
||||
use constant DC_SOCK_FILE => '/tmp/zmdc.sock';
|
||||
use constant DC_LOG_FILE => ZM_PATH_LOGS.'/zmdc.log';
|
||||
use constant VERBOSE => 0; # Whether to output more verbose debug
|
||||
|
@ -205,7 +205,7 @@ if ( !connect( CLIENT, $saddr ) )
|
|||
|
||||
if ( $daemon =~ /^${daemon_patt}$/ )
|
||||
{
|
||||
$daemon = DAEMON_PATH.$1;
|
||||
$daemon = ZM_PATH_BIN.'/'.$1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -32,12 +32,15 @@ use strict;
|
|||
# These are the elements you need to edit to suit your installation
|
||||
#
|
||||
# ==========================================================================
|
||||
use constant ZM_PATH_BIN => "<from zmconfig>";
|
||||
use constant ZM_PATH_WEB => "<from zmconfig>";
|
||||
use constant ZM_PATH_CGI => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
use constant ZM_DB_SERVER => "<from zmconfig>";
|
||||
use constant ZM_DB_NAME => "<from zmconfig>";
|
||||
use constant ZM_DB_USERA => "<from zmconfig>";
|
||||
use constant ZM_DB_PASSA => "<from zmconfig>";
|
||||
use constant ZM_DIR_EVENTS => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
use constant ZM_SHM_KEY => <from zmconfig>;
|
||||
use constant ZM_FILTER_RELOAD_DELAY => <from zmconfig>;
|
||||
use constant ZM_OPT_UPLOAD => <from zmconfig>;
|
||||
|
@ -59,7 +62,7 @@ use constant ZM_MESSAGE_ADDRESS => <from zmconfig>;
|
|||
use constant ZM_URL => <from zmconfig>;
|
||||
use constant ZM_FROM_EMAIL => <from zmconfig>;
|
||||
|
||||
use constant EVENT_PATH => "@WEB_PREFIX@/".ZM_DIR_EVENTS;
|
||||
use constant EVENT_PATH => ZM_PATH_WEB.'/.ZM_DIR_EVENTS;
|
||||
use constant LOG_FILE => ZM_PATH_LOGS.'/zmfilter-%d.log';
|
||||
use constant VERBOSE => 0; # Whether to output more verbose debug
|
||||
|
||||
|
|
|
@ -31,16 +31,19 @@ use strict;
|
|||
# These are the elements you need to edit to suit your installation
|
||||
#
|
||||
# ==========================================================================
|
||||
use constant ZM_PATH_BIN => "<from zmconfig>";
|
||||
use constant ZM_PATH_WEB => "<from zmconfig>";
|
||||
use constant ZM_PATH_CGI => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
use constant ZM_WEB_USER => "<from zmconfig>";
|
||||
use constant ZM_DB_SERVER => "<from zmconfig>";
|
||||
use constant ZM_DB_NAME => "<from zmconfig>";
|
||||
use constant ZM_DB_USERA => "<from zmconfig>";
|
||||
use constant ZM_DB_PASSA => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
use constant ZM_OPT_FAST_DELETE => "<from zmconfig>";
|
||||
use constant ZM_OPT_X10 => "<from zmconfig>";
|
||||
|
||||
use constant LOG_FILE => ZM_PATH_LOGS.'/zmpkg.log';
|
||||
use constant COMMAND_PATH => '@prefix@/bin';
|
||||
use constant WEB_USER => '@WEB_USER@/';
|
||||
use constant VERBOSE => 0; # Whether to output more verbose debug
|
||||
|
||||
|
@ -68,9 +71,9 @@ sub execute
|
|||
{
|
||||
my $command = shift;
|
||||
my ( $name ) = getpwuid( $> );
|
||||
if ( $name ne '@WEB_USER@' )
|
||||
if ( $name ne ZM_WEB_USER )
|
||||
{
|
||||
$command = "su @WEB_USER@ --shell=/bin/sh --command='$command'";
|
||||
$command = "su ".ZM_WEB_USER." --shell=/bin/sh --command='$command'";
|
||||
}
|
||||
print( STDERR "Executing: $command\n" );
|
||||
return( qx( $command ) );
|
||||
|
@ -84,7 +87,7 @@ open( STDERR, ">&LOG" ) || die( "Can't dup stderr: $!" );
|
|||
select( STDERR ); $| = 1;
|
||||
select( LOG ); $| = 1;
|
||||
|
||||
my $status = execute( COMMAND_PATH."/zmdc.pl check" );
|
||||
my $status = execute( ZM_PATH_BIN."/zmdc.pl check" );
|
||||
my $retval = 0;
|
||||
|
||||
chomp( $status );
|
||||
|
@ -92,7 +95,7 @@ if ( $command =~ /^(?:stop|restart)$/ )
|
|||
{
|
||||
if ( $status eq "running" )
|
||||
{
|
||||
execute( COMMAND_PATH."/zmdc.pl shutdown" );
|
||||
execute( ZM_PATH_BIN."/zmdc.pl shutdown" );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -104,7 +107,7 @@ if ( $command =~ /^(?:start|restart)$/ )
|
|||
{
|
||||
if ( $status eq "stopped" )
|
||||
{
|
||||
execute( COMMAND_PATH."/zmfix" );
|
||||
execute( ZM_PATH_BIN."/zmfix" );
|
||||
|
||||
my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_SERVER, ZM_DB_USERA, ZM_DB_PASSA );
|
||||
|
||||
|
@ -115,25 +118,25 @@ if ( $command =~ /^(?:start|restart)$/ )
|
|||
{
|
||||
if ( $monitor->{Function} ne 'None' )
|
||||
{
|
||||
execute( COMMAND_PATH."/zmdc.pl start zmc -d $monitor->{Device}" );
|
||||
execute( ZM_PATH_BIN."/zmdc.pl start zmc -d $monitor->{Device}" );
|
||||
if ( $monitor->{Function} eq 'Active' )
|
||||
{
|
||||
execute( COMMAND_PATH."/zmdc.pl start zma -m $monitor->{Id}" );
|
||||
execute( ZM_PATH_BIN."/zmdc.pl start zma -m $monitor->{Id}" );
|
||||
}
|
||||
}
|
||||
execute( COMMAND_PATH."/zmdc.pl start zmfilter.pl -m $monitor->{Id} -e -1" );
|
||||
execute( ZM_PATH_BIN."/zmdc.pl start zmfilter.pl -m $monitor->{Id} -e -1" );
|
||||
}
|
||||
$sth->finish();
|
||||
|
||||
if ( ZM_OPT_FAST_DELETE )
|
||||
{
|
||||
execute( COMMAND_PATH."/zmdc.pl start zmaudit.pl -d 900 -y" );
|
||||
execute( ZM_PATH_BIN."/zmdc.pl start zmaudit.pl -d 900 -y" );
|
||||
}
|
||||
if ( ZM_OPT_X10 )
|
||||
{
|
||||
execute( COMMAND_PATH."/zmdc.pl start zmx10.pl -c start" );
|
||||
execute( ZM_PATH_BIN."/zmdc.pl start zmx10.pl -c start" );
|
||||
}
|
||||
execute( COMMAND_PATH."/zmdc.pl start zmwatch.pl" );
|
||||
execute( ZM_PATH_BIN."/zmdc.pl start zmwatch.pl" );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -32,17 +32,17 @@
|
|||
#
|
||||
# ==========================================================================
|
||||
|
||||
use constant ZM_PATH_BIN => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
use constant ZM_DB_SERVER => "<from zmconfig>";
|
||||
use constant ZM_DB_NAME => "<from zmconfig>";
|
||||
use constant ZM_DB_USERA => "<from zmconfig>";
|
||||
use constant ZM_DB_PASSA => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
use constant ZM_WATCH_CHECK_INTERVAL => <from zmconfig>;
|
||||
use constant ZM_WATCH_MAX_DELAY => <from zmconfig>;
|
||||
|
||||
use constant COMMAND_PATH => '@prefix@/bin/';
|
||||
use constant WATCH_LOG_FILE => ZM_PATH_LOGS.'/zmwatch.log';
|
||||
use constant START_DELAY => 30; # To give everything time to start
|
||||
use constant START_DELAY => 30; # To give everything else time to start
|
||||
use constant VERBOSE => 0; # Whether to output more verbose debug
|
||||
|
||||
# ==========================================================================
|
||||
|
@ -94,7 +94,7 @@ while( 1 )
|
|||
if ( $monitor->{Function} ne 'None' )
|
||||
{
|
||||
# Check we have got an image recently
|
||||
my $command = COMMAND_PATH."zmu -m ".$monitor->{Id}." -t";
|
||||
my $command = ZM_PATH_BIN."/zmu -m ".$monitor->{Id}." -t";
|
||||
print( "Getting last image time for monitor $monitor->{Id} ('$command')\n" ) if ( VERBOSE );
|
||||
my $image_time = qx( $command );
|
||||
chomp($image_time);
|
||||
|
@ -106,7 +106,7 @@ while( 1 )
|
|||
next;
|
||||
}
|
||||
# If we are here then something bad has happened
|
||||
$command = COMMAND_PATH."zmdc.pl restart zmc -d ".$monitor->{Device};
|
||||
$command = ZM_PATH_BIN."/zmdc.pl restart zmc -d ".$monitor->{Device};
|
||||
print( "Restarting capture daemon ('$command')\n" );
|
||||
print( qx( $command ) );
|
||||
}
|
||||
|
|
|
@ -31,12 +31,13 @@
|
|||
#
|
||||
# ==========================================================================
|
||||
|
||||
use constant ZM_PATH_BIN => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
use constant ZM_DB_SERVER => "<from zmconfig>";
|
||||
use constant ZM_DB_NAME => "<from zmconfig>";
|
||||
use constant ZM_DB_USERA => "<from zmconfig>";
|
||||
use constant ZM_DB_PASSA => "<from zmconfig>";
|
||||
use constant ZM_DIR_EVENTS => "<from zmconfig>";
|
||||
use constant ZM_PATH_LOGS => "<from zmconfig>";
|
||||
use constant ZM_X10_DB_RELOAD_INTERVAL => 60;
|
||||
use constant ZM_X10_DEVICE => '/dev/ttyS1';
|
||||
use constant ZM_X10_HOUSE_CODE => 'K';
|
||||
|
@ -44,7 +45,6 @@ use constant ZM_SHM_KEY => 0x7a6d2000;
|
|||
|
||||
use constant X10_SOCK_FILE => '/tmp/zmx10.sock';
|
||||
use constant X10_LOG_FILE => ZM_PATH_LOGS.'/zmx10.log';
|
||||
use constant COMMAND_PATH => '@prefix@/bin/';
|
||||
use constant VERBOSE => 0; # Whether to output more verbose debug
|
||||
|
||||
# ==========================================================================
|
||||
|
@ -584,7 +584,7 @@ sub processTask
|
|||
{
|
||||
if ( $instruction eq "start" )
|
||||
{
|
||||
$command = main::COMMAND_PATH."zmdc.pl start zma -m ".$task->{monitor};
|
||||
$command = main::ZM_PATH_BIN."/zmdc.pl start zma -m ".$task->{monitor};
|
||||
if ( $task->{limit} )
|
||||
{
|
||||
addPendingTask( $task );
|
||||
|
@ -592,14 +592,14 @@ sub processTask
|
|||
}
|
||||
elsif( $instruction eq "stop" )
|
||||
{
|
||||
$command = main::COMMAND_PATH."zmdc.pl stop zma -m ".$task->{monitor};
|
||||
$command = main::ZM_PATH_BIN."/zmdc.pl stop zma -m ".$task->{monitor};
|
||||
}
|
||||
}
|
||||
elsif( $class eq "alarm" )
|
||||
{
|
||||
if ( $instruction eq "start" )
|
||||
{
|
||||
$command = main::COMMAND_PATH."zmu --monitor ".$task->{monitor}." --alarm";
|
||||
$command = main::ZM_PATH_BIN."/zmu --monitor ".$task->{monitor}." --alarm";
|
||||
if ( $task->{limit} )
|
||||
{
|
||||
addPendingTask( $task );
|
||||
|
@ -607,7 +607,7 @@ sub processTask
|
|||
}
|
||||
elsif( $instruction eq "stop" )
|
||||
{
|
||||
$command = main::COMMAND_PATH."zmu --monitor ".$task->{monitor}." --cancel";
|
||||
$command = main::ZM_PATH_BIN."/zmu --monitor ".$task->{monitor}." --cancel";
|
||||
}
|
||||
}
|
||||
print( "Executing command '$command'\n" );
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
|
||||
// This section contains options substituted by the zmconfig.pl utility, do not edit these directly
|
||||
//
|
||||
define( "ZM_DB_SERVER", "<from zmconfig>" ); // Database Server machine
|
||||
define( "ZM_PATH_BIN", "<from zmconfig>" ); // Path to binaries
|
||||
define( "ZM_PATH_WEB", "<from zmconfig>" ); // Path to web files
|
||||
define( "ZM_PATH_CGI", "<from zmconfig>" ); // Path to cgi files
|
||||
define( "ZM_DB_NAME", "<from zmconfig>" ); // Database containing the tables
|
||||
define( "ZM_DB_USERA", "<from zmconfig>" ); // Database login
|
||||
define( "ZM_DB_PASSA", "<from zmconfig>" ); // Database password
|
||||
|
@ -73,10 +75,8 @@ define( "ZM_WEB_P_REFRESH_IMAGE", <from zmconfig> ); // How often the watched im
|
|||
//
|
||||
define( "ZM_DB_USER", ZM_DB_USERA ); // Database login
|
||||
define( "ZM_DB_PASS", ZM_DB_PASSA ); // Database password
|
||||
define( "ZM_PATH", "@prefix@/bin" ); // Local path to the general ZoneMonitor executables
|
||||
define( "ZMU_PATH", ZM_PATH."/zmu" ); // Local path to the ZoneMinder Utility
|
||||
define( "ZMU_PATH", ZM_PATH_BIN."/zmu" ); // Local path to the ZoneMinder Utility
|
||||
define( "ZMS_PATH", "/cgi-bin/zms" ); // Web path to the ZoneMinder Stream server
|
||||
define( "ZM_WEB_PATH", "@WEB_PREFIX@" ); // Full path (not web) to web directory
|
||||
|
||||
// These are miscellaneous options you won't normally need to change
|
||||
//
|
||||
|
|
|
@ -79,21 +79,21 @@ function canStream()
|
|||
|
||||
function fixDevices()
|
||||
{
|
||||
$string = ZM_PATH."/zmfix";
|
||||
$string = ZM_PATH_BIN."/zmfix";
|
||||
$string .= " 2>/dev/null >&- <&- >/dev/null";
|
||||
exec( $string );
|
||||
}
|
||||
|
||||
function packageControl( $command )
|
||||
{
|
||||
$string = ZM_PATH."/zmpkg.pl $command";
|
||||
$string = ZM_PATH_BIN."/zmpkg.pl $command";
|
||||
$string .= " 2>/dev/null >&- <&- >/dev/null";
|
||||
exec( $string );
|
||||
}
|
||||
|
||||
function daemonControl( $command, $daemon=false, $args=false )
|
||||
{
|
||||
$string = ZM_PATH."/zmdc.pl $command";
|
||||
$string = ZM_PATH_BIN."/zmdc.pl $command";
|
||||
if ( $daemon )
|
||||
{
|
||||
$string .= " $daemon";
|
||||
|
@ -161,7 +161,7 @@ function zmaControl( $monitor, $restart=false )
|
|||
|
||||
function daemonCheck( $daemon=false, $args=false )
|
||||
{
|
||||
$string = ZM_PATH."/zmdc.pl check";
|
||||
$string = ZM_PATH_BIN."/zmdc.pl check";
|
||||
if ( $daemon )
|
||||
{
|
||||
$string .= " $daemon";
|
||||
|
|
|
@ -1407,7 +1407,7 @@ Learn Pref: <select name="learn_state" class="form" onChange="learn_form.su
|
|||
<?php
|
||||
if ( $mode == "stream" )
|
||||
{
|
||||
$stream_src = ZMS_PATH."?path=".ZM_WEB_PATH."&event=$eid&refresh=".STREAM_EVENT_DELAY;
|
||||
$stream_src = ZMS_PATH."?path=".ZM_PATH_WEB."&event=$eid&refresh=".STREAM_EVENT_DELAY;
|
||||
if ( isNetscape() )
|
||||
{
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue