ffac / gluon-ssid-changer

Original source of the ssid-changer. Now maintained by eulenfunk - so the package from there is used
Other
6 stars 29 forks source link

Check for Internet connectivity instead #27

Closed rubo77 closed 7 years ago

rubo77 commented 7 years ago

What if a gateway is perfectly reacheable, but due to a broken openvpn on the gateway, there is no internet connection possible through that?

Wouldn't it be wise to add a check if some IPs are reacheable? For example:


destination_ips=( '91.216.248.25' '193.99.144.85' '141.1.1.1' )
PING_OK=0
for destination_ip in ${destination_ips[@]}; do
    echo "Trying to get a reply from $destination_ip..."
    ping -q -c1 $destination_ip >& /dev/null
    if [ $? -eq 0 ]; then
        echo "Got a reply from $destination_ip, so everything seems to be in order. Exiting."
        PING_OK=1
    fi
    sleep 1
done
echo $PING_OK

I think this has to be changed to IPv6 to work on routers, that only resolve ipv6 addresses.

If the gateway is reacheable, but still no internet possible, this could be shown in the SSID as well, for example:

FF_GW2_OFFLINE
mmalte commented 7 years ago

In diesem Fall sollte auf dem entsprechenden Gateway das Gateway Flag entfernt werden.