I have a Pi which is set up with a read-only filesystem, and as such packaged network monitoring solutions aren't happy. Neither wicd nor network-manager like this setup.
I'm not a fan of either, to be honest - for a GUI based PC they have benefits but for a headless box something simpler will suffice.
I have cobbled together a basic bash script that checks to see if it can ping the default gateway and restarts wifi otherwise, but its far from elegant.
Has anyone done anything similar or found any similar scripts online that they use? Ideally, for example, it would be able to "manage" both eth0 and wlan0 (or even wlan1 - in the case of a Pi 3 with an external Wifi added in for better signal strength).
(I'm worried about edge cases with my current script. I can either run in through cron, but that risks it thinking the network is offline just because it hasn't come up yet after a boot which might have bad side effects. I'm currently running it as a systemd service with e network dependency to avoid that, but I'm not sure how that'll work if the network fails to come up after a reboot. Then there's all the things I haven't thought of...)