I need to check with a script, whether eth0 is configured. If so, the script will do nothing. Otherwise it will start wlan0. (I don't want both eth0 and wlan0 to be up at the same time).What would be the easiest way to check, whether eth0 is already up?I am using Debian WheezyCLARIFICATION:I would like to check not only that the cable in eth0 is plugged in, but rather that the interface is configured (i.e. it has either static IP set, or it has received a DHCP IP). If cable is plugged in, but eth0 is not configured correctly, I want to start wlan0
check if interface eth0 is up (configured)
linux;networking
You can do it many ways. Here an example:$ cat /sys/class/net/eth0/operstateup