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
/
F49208_DuplicateConf.awk
< prev
next >
Wrap
Text File
|
2001-02-12
|
2KB
|
55 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 {
confroot = ARGV[1];
gsub( /\\/, "/", confroot );
confroot = substr( confroot, 0, length( confroot ) - 1 ) "/";
confsrc = confroot "access.default.conf";
confdst = confroot "access.conf";
print "Duplicating " confsrc " to " confdst;
if ( ( getline < confdst ) < 0 ) {
while ( ( getline < confsrc ) > 0 ) {
print $0 > confdst;
}
}
confsrc = confroot "httpd.default.conf";
confdst = confroot "httpd.conf";
print "Duplicating " confsrc " to " confdst;
if ( ( getline < confdst ) < 0 ) {
while ( ( getline < confsrc ) > 0 ) {
print $0 > confdst;
}
}
confsrc = confroot "srm.default.conf";
confdst = confroot "srm.conf";
print "Duplicating " confsrc " to " confdst;
if ( ( getline < confdst ) < 0 ) {
while ( ( getline < confsrc ) > 0 ) {
print $0 > confdst;
}
}
confsrc = confroot "magic.default";
confdst = confroot "magic";
print "Duplicating " confsrc " to " confdst;
if ( ( getline < confdst ) < 0 ) {
while ( ( getline < confsrc ) > 0 ) {
print $0 > confdst;
}
}
confsrc = confroot "mime.types.default";
confdst = confroot "mime.types";
print "Duplicating " confsrc " to " confdst;
if ( ( getline < confdst ) < 0 ) {
while ( ( getline < confsrc ) > 0 ) {
print $0 > confdst;
}
}
}