Skip to content
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

Open
pannal opened this issue Jul 11, 2024 · 12 comments
Open

Offline scripts run multiple times #23

pannal opened this issue Jul 11, 2024 · 12 comments

Comments

@pannal
Copy link

pannal commented Jul 11, 2024

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!

@br101
Copy link
Owner

br101 commented Jul 15, 2024

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.

@pannal
Copy link
Author

pannal commented Jul 15, 2024

This is my offline script:

if [ "${GLOBAL}" == "OFFLINE" ]; then
    beep -l 50 -D 50 -n -l 50 -D 50 -n -l 50
fi

I think I'm doing what you're suggesting.

@pannal
Copy link
Author

pannal commented Jul 17, 2024

Is this the wrong approach? I'm only monitoring the "wan" interface in pingcheck. There's also wan6 and eth1.

@br101
Copy link
Owner

br101 commented Jul 18, 2024

Seems to be fine! So even though you have only one interface and you check for the global state you still get multiple beeps?

@pannal
Copy link
Author

pannal commented Jul 18, 2024

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.

@br101
Copy link
Owner

br101 commented Jul 18, 2024

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?

@pannal
Copy link
Author

pannal commented Jul 18, 2024

Sure:

pingcheck
Configured interface 'wan' interval 10 timeout 30 host 8.8.8.8 ICMP (80) ignore_ubus 0
UCI: interface 'sta' is disabled
Failed to add server object: Invalid argument

Init ICMP ping on 'wan' (eth1)
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
Resolved 8.8.8.8 to 8.8.8.8
Interface 'wan' changed to ONLINE
Scheduling 'online' scripts for 'wan'
Running 'online' scripts for 'wan'
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 7180
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 14574
ICMP echo received for different handle that was not found 9562
ICMP echo received for different handle that was not found 3471
ICMP echo received for different handle that was not found 14574
^C
wan:    ONLINE   100% (1/1 on eth1)

@pannal
Copy link
Author

pannal commented Jul 18, 2024

And my config:

config default
        option host 8.8.8.8
        option interval 10
        option timeout 30
        option protocol icmp
        ## to check via TCP connect instead of ICMP:
        #option protocol tcp
        #option tcp_port 80
        #option panic 10
        #option ignore_ubus 1

config interface
        option name wan

config interface
        option name sta
        option disabled 1
cat /etc/pingcheck/offline.d/beep.sh
#!/bin/sh

# ${INTERFACE} -- logical network interface (e.g. wan) which goes online or offline
# ${DEVICE} -- physical device (e.g. eth0) which goes online or offline
# ${GLOBAL} -- global state ONLINE or OFFLINE depending on wether device is online thru other interfaces

#if [ "${INTERFACE}" != "wan" ]; then
#    exit 0
#fi

if [ "${GLOBAL}" == "OFFLINE" ]; then
    beep -l 50 -D 50 -n -l 50 -D 50 -n -l 50
fi
cat /etc/pingcheck/online.d/beep.sh
#!/bin/sh

# ${INTERFACE} -- logical network interface (e.g. wan) which goes online or offline
# ${DEVICE} -- physical device (e.g. eth0) which goes online or offline
# ${GLOBAL} -- global state ONLINE or OFFLINE depending on wether device is online thru other interfaces

#if [ "${INTERFACE}" != "wan" ]; then
#    exit 0
#fi

if [ "${GLOBAL}" == "ONLINE" ]; then
    beep -l 50 -D 50 -n -l 150
fi

@br101
Copy link
Owner

br101 commented Jul 18, 2024

Looks like you haven't stopped the pingcheck running in the background. do /etc/init.d/pingcheck stop before

@pannal
Copy link
Author

pannal commented Jul 21, 2024

Sorry, stopped pingcheck before running the command:

pingcheck
Configured interface 'wan' interval 10 timeout 30 host 8.8.8.8 ICMP (80) ignore_ubus 0
UCI: interface 'sta' is disabled
Init ICMP ping on 'wan' (eth1)
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
Resolved 8.8.8.8 to 8.8.8.8
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
Interface 'wan' changed to ONLINE
Scheduling 'online' scripts for 'wan'
Running 'online' scripts for 'wan'
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 8506
ICMP echo received for different handle that was not found 7031
ICMP echo received for different handle that was not found 3494
^C
wan:    ONLINE   100% (1/1 on eth1)

@pannal
Copy link
Author

pannal commented Jul 26, 2024

To circumvent this, I've changed my offline script to:

if [ -f "/tmp/offline" ]; then
    exit 0
fi

if [ "${GLOBAL}" == "OFFLINE" ]; then
    beep -l 50 -D 50 -n -l 50 -D 50 -n -l 50
    touch /tmp/offline
fi

and online script to:

if [ "${GLOBAL}" == "ONLINE" ]; then
    beep -l 50 -D 50 -n -l 150
fi

rm /tmp/offline

@pannal
Copy link
Author

pannal commented Aug 2, 2024

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 touch command above the beep might fix this as beep blocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants