ref:https://unix.stackexchange.com/questions/251625/how-to-log-internet-connection-drops
while :
do
for interface in $(ls /sys/class/net/ | grep -v lo | grep -v p2p0| grep -v wlan0);
do
status=$( /bin/cat /sys/class/net/"${interface}"/carrier )
if [ $status == 1 ]; then
if [ $eth0_old_status == 0 ]; then
eth0_old_status=1
udhcpc -i "${interface}"
else
echo "${interface} already connected"
fi
fi
done
sleep 10
done