What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Appropriate User scripts AFTER a wireless client is connected?

Asad Ali

Very Senior Member
Hey guys I want to run a scripts AFTER a wireless client is connected to the router on reboot so what user script will be appropriate for it? I tested with wan-start but it seems it runs way too early.
 
There is no event-driven script associated with a wireless client connecting to the router. The best you can do is create a process that continuously pings/scans/polls the device until it becomes active.
 
There is no event-driven script associated with a wireless client connecting to the router. The best you can do is create a process that continuously pings/scans/polls the device until it becomes active.

I can't do that because my script is for restarting the router if it doesn't connect with the wireless client so a ping condition will put it in an infinite loop.

I believe a "sleep" command is my only option.
 
I can't do that because my script is for restarting the router if it doesn't connect with the wireless client so a ping condition will put it in an infinite loop.
It sounds like it would go into an infinite boot loop anyway if the client couldn't connect (e.g. was turned off, damaged or removed).
 
It sounds like it would go into an infinite boot loop anyway if the client couldn't connect (e.g. was turned off, damaged or removed).

Yes, there's still a risk for that but the wireless client is a Smart Plug switched on 24/7/365 so there's almost a zero chance that the client will turn off.
 
Yes, there's still a risk for that but the wireless client is a Smart Plug switched on 24/7/365 so there's almost a zero chance that the client will turn off.
What is the objective here? What is the interaction between the router and the smart plug that requires you to reboot the router? Can you not just restart the wireless instead?
 
What is the objective here?

I need to troubleshoot a different problem I'm facing and that's just a temporary workaround to keep my network alive.

The issue I need to diagnose is on my AX-88U (384.14 but I faced this issue on 384.13 as well) I randomly lose all wifi connections and lose WAN link as well and router somewhat falls in a halted state and only gets fixes after a reboot, so the objective here is to issue a service start_reboot command if the Smart Plug wireless link drops.
 
Hey guys I want to run a scripts AFTER a wireless client is connected to the router on reboot so what user script will be appropriate for it? I tested with wan-start but it seems it runs way too early.
Could you not exploit the dnsmasq
Code:
dhcp-script=
so you could detect @boot the fact that a specifc MAC has been assigned an IP address?
 
Could you not exploit the dnsmasq
Code:
dhcp-script=
so you could detect @boot the fact that a specifc MAC has been assigned an IP address?

I'm using manual IP assignments for my devices so the device always gets assigned the same IP pretty early @boot even if it's not yet connected to the router.

What I end up doing is add a cronjob to run every minute and see if the client replies to ping, if yes all is well and if not it issues a service start_reboot command.

In any case, it's just a temporary workaround to keep my network up and running until I don't find the actual cause of why the router hangs like this.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top