GL-USB150 DIY internet and vpn status indicator

credits to keolafu

from here AR750 DIY VPN status indicator

after reading this post I though it would be more useful then seeing a power light and a flashing light showing traffic.

so this changes the power on led to “connected to internet” and the flashing wwan light to openvpn connected.

Please follow his instructions with my minor changes as follow:

goto http://192.168.8.1/cgi-bin/luci/admin/system/leds
and uncheck “default” and set both triggers to “none”

in the inet_check.sh script change

inet_led=/sys/devices/platform/leds-gpio/leds/gl-ar750:white:wlan2g/brightness

to

inet_led=/sys/devices/platform/leds-gpio/leds/gl-usb150:green:power/brightness

and in the vpn_check.sh script change

vpn_led=/sys/devices/platform/leds-gpio/leds/gl-ar750:white:wlan5g/brightness

to

vpn_led=/sys/devices/platform/leds-gpio/leds/gl-usb150:green:wlan/brightness

I also changed

first_hop=$(traceroute 8.8.8.8 2>&1 | head -2 | tail -1 | awk '{print $2}')

if [ "$first_hop" == "10.8.0.1" ]; then

to

first_hop1=$(traceroute 8.8.8.8 2>&1 | head -2 | tail -1 | awk '{print $2}')
first_hop="${first_hop1:0:4}"
if [ "$first_hop" == "10.8" ]; then

because from glinet ovpn client to glinet ovpn server the default route is 10.8.0.1
and my vpn service provider uses 10.8.3.1 so this supports both

if your vpnservice provider is different you can check bye connecting your openvpn client to your provider and do a “traceroute 8.8.8.8” and see what your first hop is and if it is different from 10.8.x.x then you out of luck. naw just dont use it and just modify orginal script with the ip route address.

I also commented out all lines after restart because I thought gl_health should be taking care of that but l wouldn’t mind understanding it’s added benefit. I guess I was kinda worried how policy routing might be needed or left out with restarting this way.

#restart
#logger -t VPN_check RESTART openvpn
#killall openvpn 2>/dev/null
#ovpn=$(uci get glconfig.openvpn.ovpn)
#/usr/sbin/openvpn “$ovpn” &
#(sleep 1; /etc/init.d/network reload) &

1 Like