win_nssm: fix service not started when state=started
Nssm status returns a multiline output that doesn't match any of the strict patterns in the switch statement.
(cherry picked from commit 8180a7c39b
)
This commit is contained in:
parent
2409ae5f27
commit
6ea0fccfe2
1 changed files with 8 additions and 8 deletions
|
@ -525,16 +525,16 @@ Function Nssm-Start
|
|||
Throw "Error starting service ""$name"""
|
||||
}
|
||||
|
||||
switch ($currentStatus.stdout)
|
||||
switch -wildcard ($currentStatus.stdout)
|
||||
{
|
||||
"SERVICE_RUNNING" { <# Nothing to do #> }
|
||||
"SERVICE_STOPPED" { Nssm-Start-Service-Command -name $name }
|
||||
"*SERVICE_RUNNING*" { <# Nothing to do #> }
|
||||
"*SERVICE_STOPPED*" { Nssm-Start-Service-Command -name $name }
|
||||
|
||||
"SERVICE_CONTINUE_PENDING" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
"SERVICE_PAUSE_PENDING" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
"SERVICE_PAUSED" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
"SERVICE_START_PENDING" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
"SERVICE_STOP_PENDING" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
"*SERVICE_CONTINUE_PENDING*" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
"*SERVICE_PAUSE_PENDING*" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
"*SERVICE_PAUSED*" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
"*SERVICE_START_PENDING*" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
"*SERVICE_STOP_PENDING*" { Nssm-Stop-Service-Command -name $name; Nssm-Start-Service-Command -name $name }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue