Skip to content

Commit

Permalink
restart the windows service if it is running (#404)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Münch <[email protected]>
  • Loading branch information
atomic111 authored Jan 8, 2024
1 parent 8e61d1a commit a03d400
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function Install-Mondoo {


# Check if Service parameter is set and Parameter Product is set to mondoo
If ($Service.ToLower() -eq 'enable' -and $Product.ToLower() -eq 'mondoo') {
If (($Service.ToLower() -eq 'enable' -and $Product.ToLower() -eq 'mondoo') -or ((Get-Service -Name Mondoo).Status -eq 'Running')) {
# start Mondoo service
enable_service
}
Expand Down
2 changes: 1 addition & 1 deletion powershell/Mondoo.Installer/Mondoo.Installer.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function Install-Mondoo {


# Check if Service parameter is set and Parameter Product is set to mondoo
If ($Service.ToLower() -eq 'enable' -and $Product.ToLower() -eq 'mondoo') {
If (($Service.ToLower() -eq 'enable' -and $Product.ToLower() -eq 'mondoo') -or ((Get-Service -Name Mondoo).Status -eq 'Running')) {
# start Mondoo service
enable_service
}
Expand Down

0 comments on commit a03d400

Please sign in to comment.