installwinconf.awk revision 6ad55f63504cf5fe5205ed9495664519afeadcd9
50cfe8bbbaf4279375802531268e2bf0155215fetrawick#
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# InstallConf.awk Apache HTTP 2.2 script to rewrite the @@ServerRoot@@
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# tags in httpd.conf.in to original\httpd.conf - then duplicate the
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# conf files to the 'live' configuration if they don't already exist.
50cfe8bbbaf4279375802531268e2bf0155215fetrawick#
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# Note that we -don't- want the ARGV file list, so no additional {} blocks
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# are coded. Use explicit args (more reliable on Win32) and use the fact
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# that ARGV[] params are -not- '\' escaped to process the C:\Foo\Bar Win32
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# path format. Note that awk var=path would not succeed, since it -does-
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# escape backslashes in the assignment. Note also, a trailing space is
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# required for paths, or the trailing quote following the backslash is
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# escaped, rather than parsed.
50cfe8bbbaf4279375802531268e2bf0155215fetrawick#
50cfe8bbbaf4279375802531268e2bf0155215fetrawickBEGIN {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick domainname = ARGV[1];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick servername = ARGV[2];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick serveradmin = ARGV[3];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick serverport = ARGV[4];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick serversslport = ARGV[5];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick serverroot = ARGV[6];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick sourceroot = ARGV[7];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick delete ARGV[7];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick delete ARGV[6];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick delete ARGV[5];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick delete ARGV[4];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick delete ARGV[3];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick delete ARGV[2];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick delete ARGV[1];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /\\/, "/", serverroot );
2e3867b767f5f34e6ab6414670f3306806913810trawick gsub( /[ \/]+$/, "", serverroot );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick tstfl = serverroot "/logs/install.log"
50cfe8bbbaf4279375802531268e2bf0155215fetrawick confroot = serverroot "/conf/";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick confdefault = confroot "original/";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( sourceroot != "docs/conf/" ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick sourceroot = serverroot "/" sourceroot;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick usertree = ENVIRON["USERPROFILE"]
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( usertree > "" ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /\\/, "/", usertree );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /\/[^\/]+$/, "", usertree );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick } else {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick usertree = "C:/Documents and Settings";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
bbb64779da3514ea1fee8b806f5ad30d29ea45abtrawick
bbb64779da3514ea1fee8b806f5ad30d29ea45abtrawick print "Installing Apache HTTP 2.0 server with" >tstfl;
bbb64779da3514ea1fee8b806f5ad30d29ea45abtrawick print " DomainName = " domainname >tstfl;
bbb64779da3514ea1fee8b806f5ad30d29ea45abtrawick print " ServerName = " servername >tstfl;
bbb64779da3514ea1fee8b806f5ad30d29ea45abtrawick print " ServerAdmin = " serveradmin >tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print " ServerPort = " serverport >tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print " ServerSslPort = " serverport >tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print " ServerRoot = " serverroot >tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd.conf"] = "httpd.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-autoindex.conf"] = "httpd-autoindex.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-dav.conf"] = "httpd-dav.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-default.conf"] = "httpd-default.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-info.conf"] = "httpd-info.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-languages.conf"] = "httpd-languages.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-manual.conf"] = "httpd-manual.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-mpm.conf"] = "httpd-mpm.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-multilang-errordoc.conf"] = "httpd-multilang-errordoc.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-ssl.conf"] = "httpd-ssl.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-userdir.conf"] = "httpd-userdir.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd-vhosts.conf"] = "httpd-vhosts.conf.in";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick for ( conffile in filelist ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( conffile == "httpd.conf" ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick srcfl = sourceroot filelist[conffile];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick dstfl = confdefault conffile;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick bswarning = 1;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick } else {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick srcfl = sourceroot "extra/" filelist[conffile];
50cfe8bbbaf4279375802531268e2bf0155215fetrawick dstfl = confdefault "extra/" conffile;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick bswarning = 0;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick while ( ( getline < srcfl ) > 0 ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( bswarning && /^$/ ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "# NOTE: Where filenames are specified, you must use forward slashes" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "# instead of backslashes (e.g., \"c:/apache\" instead of \"c:\\apache\")." > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "# If a drive letter is omitted, the drive on which httpd.exe is located" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "# will be used by default. It is recommended that you always supply" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "# an explicit drive letter in absolute paths to avoid confusion." > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick bswarning = 0;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( /@@LoadModule@@/ ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule access_compat_module modules/mod_access_compat.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule actions_module modules/mod_actions.so" > dstfl;
7a42584e6f09102c6776454f090b98a58fd590ebtrawick print "LoadModule alias_module modules/mod_alias.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule asis_module modules/mod_asis.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule auth_basic_module modules/mod_auth_basic.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule auth_digest_module modules/mod_auth_digest.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule authn_anon_module modules/mod_authn_anon.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule authn_core_module modules/mod_authn_core.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule authn_dbd_module modules/mod_authn_dbd.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule authn_dbm_module modules/mod_authn_dbm.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule authn_file_module modules/mod_authn_file.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule authz_core_module modules/mod_authz_core.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule authz_dbd_module modules/mod_authz_dbd.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule authz_dbm_module modules/mod_authz_dbm.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule authz_groupfile_module modules/mod_authz_groupfile.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule authz_host_module modules/mod_authz_host.so" > dstfl;
7a42584e6f09102c6776454f090b98a58fd590ebtrawick print "#LoadModule authz_owner_module modules/mod_authz_owner.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule authz_user_module modules/mod_authz_user.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule autoindex_module modules/mod_autoindex.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule cache_module modules/mod_cache.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule cern_meta_module modules/mod_cern_meta.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule cgi_module modules/mod_cgi.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule charset_lite_module modules/mod_charset_lite.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule dav_module modules/mod_dav.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule dav_fs_module modules/mod_dav_fs.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule dav_lock_module modules/mod_dav_lock.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule dbd_module modules/mod_dbd.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule deflate_module modules/mod_deflate.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule dir_module modules/mod_dir.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule disk_cache_module modules/mod_disk_cache.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule dumpio_module modules/mod_dumpio.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule env_module modules/mod_env.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule expires_module modules/mod_expires.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule ext_filter_module modules/mod_ext_filter.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule file_cache_module modules/mod_file_cache.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule filter_module modules/mod_filter.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule headers_module modules/mod_headers.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule ident_module modules/mod_ident.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule imagemap_module modules/mod_imagemap.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule include_module modules/mod_include.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule info_module modules/mod_info.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule isapi_module modules/mod_isapi.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule ldap_module modules/mod_ldap.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule logio_module modules/mod_logio.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule log_config_module modules/mod_log_config.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule log_forensic_module modules/mod_log_forensic.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule mem_cache_module modules/mod_mem_cache.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule mime_module modules/mod_mime.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule mime_magic_module modules/mod_mime_magic.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule negotiation_module modules/mod_negotiation.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule proxy_module modules/mod_proxy.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule proxy_connect_module modules/mod_proxy_connect.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule proxy_http_module modules/mod_proxy_http.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule rewrite_module modules/mod_rewrite.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "LoadModule setenvif_module modules/mod_setenvif.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule speling_module modules/mod_speling.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule ssl_module modules/mod_ssl.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule status_module modules/mod_status.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule substitute_module modules/mod_substitute.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule unique_id_module modules/mod_unique_id.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule userdir_module modules/mod_userdir.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule usertrack_module modules/mod_usertrack.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule version_module modules/mod_version.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "#LoadModule vhost_alias_module modules/mod_vhost_alias.so" > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick continue;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
210116e11414ce7a3789652725be298b5f073056jailletc gsub( /^SSLMutex.*/, "SSLMutex default" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@@ServerRoot@@/, serverroot );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@exp_cgidir@/, serverroot "/cgi-bin" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@exp_sysconfdir@/, serverroot "/conf" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@exp_errordir@/, serverroot "/error" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@exp_htdocsdir@/, serverroot "/htdocs" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@exp_iconsdir@/, serverroot "/icons" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@exp_manualdir@/, serverroot "/manual" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@exp_runtimedir@/, serverroot "/logs" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( gsub( /@exp_logfiledir@/, serverroot "/logs" ) ||
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@rel_logfiledir@/, "logs" ) ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /_log"/, ".log\"" )
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@rel_runtimedir@/, "logs" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@rel_sysconfdir@/, "conf" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /\/home\/\*\/public_html/, \
50cfe8bbbaf4279375802531268e2bf0155215fetrawick usertree "/*/My Documents/My Website" );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /UserDir public_html/, "UserDir \"My Documents/My Website\"" );
2e3867b767f5f34e6ab6414670f3306806913810trawick gsub( /@@ServerName@@|www.example.com/, servername );
2e3867b767f5f34e6ab6414670f3306806913810trawick gsub( /@@ServerAdmin@@|you@example.com/, serveradmin );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@@DomainName@@|example.com/, domainname );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub( /@@Port@@/, serverport );
2e3867b767f5f34e6ab6414670f3306806913810trawick gsub( /@@SSLPort@@|443/, serversslport );
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print $0 > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick close(srcfl);
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( close(dstfl) >= 0 ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "Rewrote " srcfl "\n to " dstfl > tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub(/\//, "\\", srcfl);
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( sourceroot != "docs/conf/" ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if (system("del \"" srcfl "\"")) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "Failed to remove " srcfl > tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick } else {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "Successfully removed " srcfl > tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick } else {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "Failed to rewrite " srcfl "\n to " dstfl > tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist[conffile] = "extra/";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["httpd.conf"] = "";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["charset.conv"] = "";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["magic"] = "";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick filelist["mime.types"] = "";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick for ( conffile in filelist ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick srcfl = confdefault filelist[conffile] conffile;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick dstfl = confroot filelist[conffile] conffile;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( ( getline < dstfl ) < 0 ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick while ( ( getline < srcfl ) > 0 ) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print $0 > dstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "Duplicated " srcfl "\n to " dstfl > tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick } else {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "Existing file " dstfl " preserved" > tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick close(srcfl);
50cfe8bbbaf4279375802531268e2bf0155215fetrawick close(dstfl);
2e3867b767f5f34e6ab6414670f3306806913810trawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if ( sourceroot != "docs/conf/" ) {
2e3867b767f5f34e6ab6414670f3306806913810trawick srcfl = confdefault "installwinconf.awk";
50cfe8bbbaf4279375802531268e2bf0155215fetrawick gsub(/\//, "\\", srcfl);
50cfe8bbbaf4279375802531268e2bf0155215fetrawick if (system("del \"" srcfl "\"")) {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "Failed to remove " srcfl > tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick } else {
50cfe8bbbaf4279375802531268e2bf0155215fetrawick print "Successfully removed " srcfl > tstfl;
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick }
50cfe8bbbaf4279375802531268e2bf0155215fetrawick close(tstfl);
50cfe8bbbaf4279375802531268e2bf0155215fetrawick}
50cfe8bbbaf4279375802531268e2bf0155215fetrawick