#
# InstallConf.awk Apache HTTP 2.x script to rewrite the @@ServerRoot@@
# tags in httpd.conf.in to original\httpd.conf - then duplicate the
# conf files to the 'live' configuration if they don't already exist.
#
# 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 backslashes in the assignment. Note also, a trailing space is
# required for paths, or the trailing quote following the backslash is
# escaped, rather than parsed.
#
BEGIN {
domainname = ARGV[1];
servername = ARGV[2];
serveradmin = ARGV[3];
serverport = ARGV[4];
serversslport = ARGV[5];
serverroot = ARGV[6];
sourceroot = ARGV[7];
tstfl = serverroot "/logs/install.log"
}
} else {
}
bswarning = 1;
} else {
bswarning = 0;
}
bswarning = 0;
}
continue;
}
}
}
gsub( /\/home\/\*\/public_html/, \
gsub( /@@ServerName@@|www.example.com/, servername );
gsub( /@@ServerAdmin@@|you@example.com/, serveradmin );
gsub( /@@DomainName@@|example.com/, domainname );
gsub( /@@Port@@/, serverport );
gsub( /@@SSLPort@@|443/, serversslport );
print $0 > dstfl;
}
close(srcfl);
if ( close(dstfl) >= 0 ) {
gsub(/\//, "\\", srcfl);
} else {
}
}
} else {
}
}
for ( conffile in filelist ) {
srcfl = confdefault filelist[conffile] conffile;
dstfl = confroot filelist[conffile] conffile;
if ( ( getline < dstfl ) < 0 ) {
while ( ( getline < srcfl ) > 0 ) {
print $0 > dstfl;
}
} else {
}
close(srcfl);
close(dstfl);
}
gsub(/\//, "\\", srcfl);
} else {
}
}
close(tstfl);
}