wifi-sentinel: do not check port (no swconfig in 22)
This commit is contained in:
parent
c089c2e2e0
commit
8311443aa4
|
@ -22,14 +22,6 @@ else
|
|||
NETWORK="$p"
|
||||
fi
|
||||
|
||||
p=$(uci get wifi-sentinel.@wifi-sentinel[0].switchport)
|
||||
if [ -z "$p" ]; then
|
||||
PORT=1
|
||||
else
|
||||
PORT="$p"
|
||||
fi
|
||||
|
||||
|
||||
STATUS='unknown'
|
||||
|
||||
lightsoff()
|
||||
|
@ -50,16 +42,6 @@ lightson()
|
|||
fi
|
||||
}
|
||||
|
||||
port_check()
|
||||
{
|
||||
LINK=`swconfig dev switch0 port $PORT show | awk '/link/ {print $3}'`
|
||||
if [ "$LINK" = 'link:up' ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
ping_check()
|
||||
{
|
||||
local target
|
||||
|
@ -75,7 +57,7 @@ ping_check()
|
|||
/usr/bin/logger -t wifi-sentinel -p daemon.info "Starting Wi-Fi Sentinel on the $NETWORK network with $PACKETS checks every $INTERVAL seconds."
|
||||
|
||||
while true ; do
|
||||
if port_check && ping_check; then
|
||||
if ping_check; then
|
||||
lightson
|
||||
else
|
||||
lightsoff
|
||||
|
|
Loading…
Reference in New Issue