Skip to content

Commit

Permalink
Various changes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
enderandpeter committed Nov 7, 2013
1 parent 613c4b8 commit 690b986
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions a2enmod.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 690b986

Please sign in to comment.