From 8311443aa456b3bc206acea1c489e63c3bb978aa Mon Sep 17 00:00:00 2001 From: OpenFest Server User Date: Tue, 11 Oct 2022 13:19:02 +0300 Subject: [PATCH] wifi-sentinel: do not check port (no swconfig in 22) --- files/all/usr/bin/wifi-sentinel.sh | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/files/all/usr/bin/wifi-sentinel.sh b/files/all/usr/bin/wifi-sentinel.sh index 2294736..1eb4a40 100755 --- a/files/all/usr/bin/wifi-sentinel.sh +++ b/files/all/usr/bin/wifi-sentinel.sh @@ -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