LED Issue (Boot Sequence?)

I’m using a script which restores a working AP in the absence of the STA connection, this script is called from rc.local so occurs at boot.

The only issue is whilst the power LED remains on, the right hand LED (showing the SSID is broadcast / a connection has been made) does not work.

I imagine this is because this script runs before the LED is activated, would this be resolved by calling the script at a different time during the boot up sequence?

If so, is there a better way to launch this script than calling it from rc.local?

I’ve pasted the script below in case it’s an issue with the script itself. Thanks for any help :slight_smile:

#!/bin/sh

AP_DEV=wlan0

while ( true ) ; do
if !( iw dev $AP_DEV info | grep -q ssid ) ; then
logger wifi-watchdog: Wifi in trouble, to the rescue…
ifconfig $AP_DEV down;
ifconfig $AP_DEV up;
fi
sleep 5
done

I think running from rc.local is the best way, as seems there is not hotplug scripts for this.

When you call from rc.local, be sure to add “&” to the end of the line to ask it run in the background.

When the LED is having trouble, add the following code to your script

/etc/init.d/led restart

 

Thank-you that worked perfectly :slight_smile: