Check your Network Interface Card cat /sys/class/net/eth0/carrier or, cat /sys/class/net/eth0/operstate if the result is 0 or down , it means your NIC to cable is not connected . if the result is 1 or up , it means your NIC to cable is connected .
sharing notes on : howto, tutorial, open source, and linux about