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
The event listener I suggested:
inotifywait -e modify /sys/class/net/eth0/carrier; echo 'Change detected'
When you plug or unplug network cable, it will trigger echo 'Change detected', of course it could trigger just about anything.
And this will run as one off, but I take you know how to make a daemon out of it, if not it will be a good exercise to learn :)