Hi,
Thanks for this code!
When I tried this code on Ignition 8+ it failed because the following import in the gateway startup/shutdown script is changed in Ignition 8+.
from com.inductiveautomation.ignition.gateway import SRContext
That line of code is changed to:
from com.inductiveautomation.ignition.gateway import IgnitionGateway