-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offline scripts run multiple times #23
Comments
The intended behavior would be to run the scripts for every interface that goes on/offline. Could that be why you are seeing multiple calls? That's why the GLOBAL state exists. |
This is my offline script:
I think I'm doing what you're suggesting. |
Is this the wrong approach? I'm only monitoring the "wan" interface in pingcheck. There's also wan6 and eth1. |
Seems to be fine! So even though you have only one interface and you check for the global state you still get multiple beeps? |
Exactly. What might happen: The modem gets restarted when I'm offline for too long (via home assistant); the IP of wan might change multiple times, so the device might come up and go down again. But it's never "online" during that state (the online script also doesn't get called), and the offline script gets called multiple times when that happens. |
OK. Honestly it's been a while since i worked on this project and i can't remember all the details. Could you start pingcheck in the foreground and send me the output there? |
Sure:
|
And my config:
|
Looks like you haven't stopped the pingcheck running in the background. do /etc/init.d/pingcheck stop before |
Sorry, stopped pingcheck before running the command:
|
To circumvent this, I've changed my offline script to:
and online script to:
|
Hmm no, even that circumvention doesn't work reliably. I guess the online script is called intermittently and possibly so quickly after the offline script, that the beep commands overlap. Edit: Moving the |
Hey,
Maybe this is intended behavior, but it can happen that the offline scripts are run multiple times before the connection is back and the online scripts run.
I'm comparing the GLOBAL state against "OFFLINE" in my offline script and run a beep command.
Is this intended behavior? Shouldn't they only run once when the state doesn't change?
Thanks!
The text was updated successfully, but these errors were encountered: