Good day,
I would like to have my 3G modem auto connect too the internet if there is no internet on eth0. When internet on eth0 returns then it must disconnect the 3G modem again. I have successfully managed to configure a USB 3G modem to allow my pi to connect too the internet however I have no way of testing if eth0 is up again to trigger the disconnect of the 3G modem. Also another issue I ran into is that once the 3G modem is disconnected there is no internet even if there is internet on eth0. The only way I could get eth0 to work again is by running the following commands in the terminal.
sudo ifup --force eth0
I would like to do this in python but I don't even know where to start with only testing the eth0 if it has internet and monitoring its status. Please can someone assist me. Thanks in advance.