I have been using scripts with scheduling for years. But a conversation with someone else made me wonder.
Application:
I have 2 ISP feeds and use a recursive routing table to pick between primary and secondary.
I have a script that checks when if the primary is active or not.
I assign a 1 or a 0.
Then I compare if the last result was 1 or 0. If the last state is the same... Nothing happens.
If the last state doesn't match... I flush the ip firewall connections. And change the global variable to the correct 1 or 0.
I was going to run this every 60 seconds.
Is there a way to have a script run persistent that takes action as soon as the status changes?
Or
Do I just stick with a script run by a scheduler?