In Ubuntu (the latest distro is fine), I want to reboot a router and inside a bash script I\'d like to have a command that waits for the network link to be up again and, whe
You can check link is up/down by /sys/class/net/eth0/carrier file
cat /sys/class/net/eth0/carrier
if output is 1 then ethernet cable is plugged in and link is up.
if output is 0 then ethernet cable is removed and link is down.
Note:if you have interface other then eth0 then replace interface like eth2/eth3 in place of eth0