Setup blinking WPS light

Hi guys.

I have tp-link c59 v2.1 router powered by openwrt OpenWrt SNAPSHOT r11692-922b538cc9
I have an idea to use WPS light for VPN indication. So as per I'm using polycy based VPN (strongswan) it no device to trigger (like tun x) I decided just ping remote host reachable via VPN and turn on WPS light if it's available or turn light off in case ping successful.
I'm using following script:
++++++++++++++
#!/bin/sh

DELAYINTERVAL=10
LED="tp-link:green:wps"
VPNLED=0

while sleep $DELAYINTERVAL
do
if ping 192.168.172.12 -c2 ; then
if [ $VPNLED -eq 0 ]; then
echo '255' > /sys/class/leds/$LED/brightness
VPNLED=1
fi
else
if [ $VPNLED -eq 1 ]; then
echo '0' > /sys/class/leds/$LED/brightness
VPNLED=0
fi
fi
done;
++++++++++++++

script working well whenever 192.168.172.12 is reachable from openwrt router WSP light goes solid green, but whenever .172.12 unreachable it goes off.
i put this script to /etc/rc.local
does somebody show me who to "register this scpt in system? register it via /etc/config/ and control via /etc/inint.d/ after
Secondly. is it possible to modify script and force WPS light blinking whrnever TX/RX triggered for tunnel traffic (traffic to/from subnet 192.168.172.0/28)

What do you think?

Thank you.

ok. I've found solution. Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.