the check if there is a connectivity to the gateway is not really reliable every time. There are cases with very high traffic, where the gatewaycheck results in no gateway, although the traffic stil goes through. changing the ssid that moment could break backup sessions for instance.
It is already a good solution to only change to ofline every timeframe. This can be anhanced:
every minute there is a check, if the gateway is reacheable and if so, it should be logged into a temp file
at the end of the timeframe, there should be a check, if more than 50% of those checks where negative, and only then, the node should swith to offline
the check if there is a connectivity to the gateway is not really reliable every time. There are cases with very high traffic, where the gatewaycheck results in no gateway, although the traffic stil goes through. changing the ssid that moment could break backup sessions for instance.
It is already a good solution to only change to ofline every timeframe. This can be anhanced:
every minute there is a check, if the gateway is reacheable and if so, it should be logged into a temp file at the end of the timeframe, there should be a check, if more than 50% of those checks where negative, and only then, the node should swith to offline