(imported topic written by Matt.Johnson)
Hello TEM Gurus,
I currently have an Action script that pauses to let a service start before continuing. However, I really would like to have the script wait specifically for the service to start or stop. Currently I use the
parameter “startTime”="{now}"
Action Line
pause while { (now-time(parameter “startTime”) < 15*second) }
Action Line
method. While this works, it leaves room for a fatal flaw. A service failing to start. So here is my question:
Using the SMCSERVICE service, what command can I use to tell the Action script to:
WAIT for SMCSERVICE to STOP before continuing?
-and-
WAIT FOR SMCSERVICE to START before continuing?
Thanks again everyone for helping me out!
(imported comment written by jeremylam)
You can add to your existing pause statement to check if a service is running. You should leave the 15 second limit in place in case the service refuses to start, putting the action in an infinite run state.
The “continue if” statement is used to completely stop the action if the service has not started in 15 seconds.
pause while { (now-time(parameter "startTime") < 15*second) OR NOT exists running service "browser"}
continue if {exists running service "browser"}
(imported comment written by jeremylam)
Sorry, I think those two statements should be AND’ed together not OR’ed:
pause while { (now-time(parameter "startTime") < 15*second) AND NOT exists running service "browser"}
continue if {exists running service "browser"}
(imported comment written by Matt.Johnson)
Jeremy,
Thank you. I also agree they should be AND’d as OR would just continue to the next action after 15 seconds reguardless of the service state.
Thanks for the response, it worked great!