home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2002 April
/
PCWorld_2002-04_cd.bin
/
Komunik
/
apache
/
apache_1.3.23-win32-x86-no_src.msi
/
Data.Cab
/
F46421_RewriteConf.awk
< prev
next >
Wrap
Text File
|
2001-02-12
|
940b
|
27 lines
#
# RewriteConf.awk script to rewrite the @@ServerRoot@@ tags in httpd.conf
#
# Note that we -don't- want the ARGV file list, so no additional {} blocks
# are coded. Use explicit args (more reliable on Win32) and use the fact
# that ARGV[] params are -not- '\' escaped to process the C:\Foo\Bar Win32
# path format. Note that awk var=path would not succeed, since it -does-
# '\' escape the assignment.
#
BEGIN {
srcfl = ARGV[1];
dstfl = ARGV[2];
serverroot = ARGV[3];
domain = ARGV[4];
servername = ARGV[5];
serveradmin = ARGV[6];
gsub( /\\/, "/", serverroot );
serverroot = substr( serverroot, 0, length( serverroot ) - 2 );
while ( ( getline < srcfl ) > 0 ) {
gsub( /@@ServerRoot@@/, serverroot );
gsub( /@@Domain@@/, domain );
gsub( /@@ServerName@@/, servername );
gsub( /@@ServerAdmin@@/, serveradmin );
print $0 > dstfl;
}
}