Ignore me. OP says startup which somehow became shutdown in my head.
Never mind.
Sent from my iPhone using Tapatalk
how to run a script ONLY ONCE at start of indigo
Re: how to run a script ONLY ONCE at start of indigo
I came here to drink milk and kick ass....and I've just finished my milk.
My Plugins and Scripts
My Plugins and Scripts
- Hackencrash
- Posts: 251
- Joined: Wed Dec 16, 2015 7:05 am
- Location: UK
Re: how to run a script ONLY ONCE at start of indigo
Yes please Karl, I’d love a copy of an Indigo shutdown plugin to trigger a voice announce and email as I’ve been caught out a couple of times where MacOS has updated and not restarted cleanly. No need to productionize it - I’ll take it as is.
I had a rubbish heating script which left the house absolutely boiling hot after failing to run after an OS update - oops!
Sent from my iPhone using Tapatalk
I had a rubbish heating script which left the house absolutely boiling hot after failing to run after an OS update - oops!
Sent from my iPhone using Tapatalk
- jay (support)
- Site Admin
- Posts: 19232
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: how to run a script ONLY ONCE at start of indigo
I HIGHLY recommend turning off auto updates for just this reason. That way you can update when you can focus your full attention on the whole process (including dealing with issues).
Re: how to run a script ONLY ONCE at start of indigo
It’s on my GitHub/kw123
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk
Re: how to run a script ONLY ONCE at start of indigo
I know the shutdown plugin is a work around.. and yes it will fire if its reloaded .. that why there is the enable variable test included.. But a regular indigo event would be really nice and ?easy to do?..
.. is there a log file entry when indigo shuts down? we could use that one for an "and" trigger
Karl
.. is there a log file entry when indigo shuts down? we could use that one for an "and" trigger
Karl
- jay (support)
- Site Admin
- Posts: 19232
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: how to run a script ONLY ONCE at start of indigo
Not necessarily easy. The problem is how long should the server wait on actions fired from a shutdown trigger until it kills them? If, for instance, the action on the shutdown trigger fired an external script (which could run forever), how long should it wait until it kills the script and continues the shutdown? What if it gets the shutdown notification from the OS rather than from the client? Perhaps the shutdown came from a UPS where the battery is about to go out so you'd want the server to shut down quickly (but we don't know the circumstances for the shutdown request).kw123 wrote:But a regular indigo event would be really nice and ?easy to do?..
So, technically, it would be pretty simple to generate the event itself. But the problem is what happens after the server fires the actions for the event(s). I'm sure there are other reasons why doing a shutdown trigger is tricky. And, honestly, demand has been quite low anyway so it's an easy one to kick down the road.
Re: how to run a script ONLY ONCE at start of indigo
I understand the issues.. but still need one .
So I will stick with the little plugin and will add a logfile scan (tail -1000) scanning for indigo shutdown ..
Karl
So I will stick with the little plugin and will add a logfile scan (tail -1000) scanning for indigo shutdown ..
Karl
Re: how to run a script ONLY ONCE at start of indigo
Tuned the plugin a little:
now checks if "Quitting Indigo Server - stopping plugins" is in the last 400 lines of the indigo logfile and is not followed by "Loading plugin"
Only then AND if the variable "shutdownActionEnabled" is set to 1, true, or yes the shutdown action is performed.
Karl
github.com/kw123
now checks if "Quitting Indigo Server - stopping plugins" is in the last 400 lines of the indigo logfile and is not followed by "Loading plugin"
Only then AND if the variable "shutdownActionEnabled" is set to 1, true, or yes the shutdown action is performed.
Karl
github.com/kw123