I connect to the internet over a USB conenction to a flaky cable modem. Occasionally the modem OS appears to reboot, resetting the network interface and causing the IP configuration to be lost, as well as shutting down all network services. Is there a way to restart dhcpcd when it reconnects without killing the network services depending on net.eth1, or, failing that, automatically restart net.eth1 and run rc to restart the services once the modem reconnects?
This is a script that executes each time you get an IP from the server, I use it for my ppp connection to start my firewall. Because you have an ethx (as opposed to pppx), your configuration might be different.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan
I currently restart it by hand, but I need it to restart unattended. It won't get an IP from the server automatically, which is the problem, so the if-up file (which I think is ppp-only) won't help.