mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[macOS] Add apache and nginx (#2522)
* add apache and nginx * swap config and service status * add new line * remove notes
This commit is contained in:
committed by
GitHub
parent
ed5d4dc5c5
commit
5537d89215
41
images/macos/software-report/SoftwareReport.WebServers.psm1
Normal file
41
images/macos/software-report/SoftwareReport.WebServers.psm1
Normal file
@@ -0,0 +1,41 @@
|
||||
function Get-ApacheVersion {
|
||||
$name = "httpd"
|
||||
$port = 80
|
||||
$version = brew list $name --versions | Take-Part -Part 1
|
||||
$serviceStatus = (brew services list) -match $name | Take-Part -Part 1
|
||||
$configFile = "$(brew --prefix)/etc/httpd/httpd.conf"
|
||||
return [PsCustomObject]@{
|
||||
"Name" = $name
|
||||
"Version" = $version
|
||||
"ConfigFile" = $configFile
|
||||
"ServiceStatus" = $serviceStatus
|
||||
"ListenPort" = $port
|
||||
}
|
||||
}
|
||||
|
||||
function Get-NginxVersion {
|
||||
$name = "nginx"
|
||||
$port = 80
|
||||
$version = brew list $name --versions | Take-Part -Part 1
|
||||
$serviceStatus = (brew services list) -match $name | Take-Part -Part 1
|
||||
$configFile = "$(brew --prefix)/etc/nginx/nginx.conf"
|
||||
return [PsCustomObject]@{
|
||||
"Name" = $name
|
||||
"Version" = $version
|
||||
"ConfigFile" = $configFile
|
||||
"ServiceStatus" = $serviceStatus
|
||||
"ListenPort" = $port
|
||||
}
|
||||
}
|
||||
|
||||
function Build-WebServersSection {
|
||||
$output = ""
|
||||
$output += New-MDHeader "Web Servers" -Level 3
|
||||
$output += @(
|
||||
(Get-ApacheVersion),
|
||||
(Get-NginxVersion)
|
||||
) | Sort-Object Name | New-MDTable
|
||||
|
||||
$output += New-MDNewLine
|
||||
return $output
|
||||
}
|
||||
Reference in New Issue
Block a user