GL-USB150 DIY internet and vpn status indicator

credits to keolafu

from here AR750 DIY VPN status indicator - #5 by keolafu

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:

and uncheck “default” and set both triggers to “none”

in the script change




and in the script change




I also changed

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

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


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

because from glinet ovpn client to glinet ovpn server the default route is
and my vpn service provider uses 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” 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.

#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