In a Linux environment, I need to detect the physical connected or disconnected state of an RJ45 connector to its socket. Preferably using BASH scripting only.
The
on arch linux. (im not sure on other distros) you can view the operstate. which shows up if connected or down if not the operstate lives on
/sys/class/net/(interface name here)/operstate #you can also put watch watch -d -n -1 /sys/class/net/(interface name here)/operstate