Added web and cgi paths and made it operate on new file type .z

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@331 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2003-01-15 14:41:05 +00:00
parent 0999bc2197
commit 2e6d7e6699
1 changed files with 19 additions and 4 deletions

View File

@ -87,6 +87,22 @@ my @options =
type => $types{abs_path},
readonly => 1,
},
{
name => "ZM_WEB_PATH",
default => "@WEB_PREFIX@",
description => "Path to the ZoneMinder web files, autogenerated do not change",
help => "The path where the ZoneMinder web files are installed is set at configure time. This is a readonly option for the purposes of distributing this information around the various binaries and scripts that need to know it. Changing this option here will tend to break things. Instead re-run configure to regenerate the path."
type => $types{abs_path},
readonly => 1,
},
{
name => "ZM_CGI_PATH",
default => "@CGI_PREFIX@",
description => "Path to the ZoneMinder cgi files, autogenerated do not change",
help => "The path where the ZoneMinder cgi files are installed is set at configure time. This is a readonly option for the purposes of distributing this information around the various binaries and scripts that need to know it. Changing this option here will tend to break things. Instead re-run configure to regenerate the path."
type => $types{abs_path},
readonly => 1,
},
{
name => "ZM_WEB_USER",
default => "@WEB_USER@",
@ -866,7 +882,8 @@ if ( $reprocess )
{
print( "Processing '$config_file'\n" );
local $/ = undef;
open( CFG_IN_FILE, $config_file ) or die( "Can't open '$config_file' for reading" );
my $config_z_file = $config_file.".z";
open( CFG_IN_FILE, $config_z_file ) or die( "Can't open '$config_z_file' for reading" );
my $data = <CFG_IN_FILE>;
close( CFG_IN_FILE );
if ( $config_file =~ /\.h$/ )
@ -968,10 +985,8 @@ if ( $reprocess )
warn( "Unrecognised file type '$config_file'" );
next;
}
my $config_tmp_file = $config_file.".tmp";
open( CFG_FILE, ">$config_tmp_file" ) or die( "Can't open '$config_tmp_file' for writing" );
open( CFG_FILE, ">$config_file" ) or die( "Can't open '$config_file' for writing" );
print( CFG_FILE $data );
close( CFG_FILE );
rename( $config_tmp_file, $config_file ) or warn( "Can't rename '$config_tmp_file' to '$config_file': $!" );
}
}