mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 06:06:32 +00:00
use sys/class/net/*/operstate instead of mii-tool to check ethernet state
This commit is contained in:
parent
37518e99b2
commit
346355bd1a
@ -34,7 +34,7 @@ watch_eth() {
|
|||||||
count=0
|
count=0
|
||||||
while true; do
|
while true; do
|
||||||
sleep 5
|
sleep 5
|
||||||
if mii-tool $eth 2>&1 | grep "link ok" > /dev/null; then
|
if [ "$(cat /sys/class/net/$eth/operstate 2>/dev/null)" == "up" ]; then
|
||||||
count=0
|
count=0
|
||||||
else
|
else
|
||||||
if [ $count -lt $link_watch_timeout ]; then
|
if [ $count -lt $link_watch_timeout ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user