From 690b98603dd034455fa925ad226c1251a47aa45e Mon Sep 17 00:00:00 2001 From: Spencer Williams Date: Thu, 7 Nov 2013 16:02:20 -0700 Subject: [PATCH] Various changes Added a space to an error message and changed a directory separator to the right one for Windows. Although it would be rare, added a check that would more effectively determine if the conf file discovered from the httpd commands cannot be found. --- a2enmod.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/a2enmod.ps1 b/a2enmod.ps1 index 255905b..a0d2b2e 100644 --- a/a2enmod.ps1 +++ b/a2enmod.ps1 @@ -17,7 +17,7 @@ if($MyInvocation.InvocationName -match "a2(en|dis)(mod|site)"){ $act = $matches[1] $obj = $matches[2] } else { - write-host $MyInvocation.InvocationName "call not recognized" + write-host $MyInvocation.InvocationName " call not recognized" } $run_cfg = httpd -D DUMP_RUN_CFG @@ -34,12 +34,12 @@ $mod_dir = $ServerRoot + "\modules" # Find the main configuration file httpd -V | foreach{ if($_ -match "-D SERVER_CONFIG_FILE=\W(.*)\W"){ - $conf = $ServerRoot + "/" + $matches[1] + $conf = $ServerRoot + "\" + $matches[1] } } -if(!$conf){ - write-host -foregroundcolor RED -backgroundcolor BLACK "httpd configuration directory could not be found" +if(!(get-item $conf)){ + write-host -foregroundcolor RED -backgroundcolor BLACK "httpd configuration file could not be found" exit } else { $conf = get-item $conf