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"
|
NETWORK="$p"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
p=$(uci get wifi-sentinel.@wifi-sentinel[0].switchport)
|
|
||||||
if [ -z "$p" ]; then
|
|
||||||
PORT=1
|
|
||||||
else
|
|
||||||
PORT="$p"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
STATUS='unknown'
|
STATUS='unknown'
|
||||||
|
|
||||||
lightsoff()
|
lightsoff()
|
||||||
|
@ -50,16 +42,6 @@ lightson()
|
||||||
fi
|
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()
|
ping_check()
|
||||||
{
|
{
|
||||||
local target
|
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."
|
/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
|
while true ; do
|
||||||
if port_check && ping_check; then
|
if ping_check; then
|
||||||
lightson
|
lightson
|
||||||
else
|
else
|
||||||
lightsoff
|
lightsoff
|
||||||
|
|
Loading…
Reference in New Issue