wifi-sentinel: make the switchport configurable, as it differs
This commit is contained in:
parent
df0e5bceee
commit
dc022f9e55
|
@ -1,11 +1,36 @@
|
|||
#!/bin/sh
|
||||
. /lib/functions/network.sh
|
||||
|
||||
p=$(uci get wifi-sentinel.@wifi-sentinel[0].packets)
|
||||
if [ -z "$p" ]; then
|
||||
PACKETS='3'
|
||||
else
|
||||
PACKETS="$p"
|
||||
fi
|
||||
|
||||
p=$(uci get wifi-sentinel.@wifi-sentinel[0].interval)
|
||||
if [ -z "$p" ]; then
|
||||
INTERVAL='10'
|
||||
STATUS='unknown'
|
||||
else
|
||||
INTERVAL="$p"
|
||||
fi
|
||||
|
||||
p=$(uci get wifi-sentinel.@wifi-sentinel[0].network)
|
||||
if [ -z "$p" ]; then
|
||||
NETWORK='management'
|
||||
PORT='1'
|
||||
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()
|
||||
{
|
||||
|
@ -27,7 +52,7 @@ lightson()
|
|||
|
||||
port_check()
|
||||
{
|
||||
LINK=`swconfig dev switch0 port 1 show | awk '/link/ {print $3}'`
|
||||
LINK=`swconfig dev switch0 port $PORT show | awk '/link/ {print $3}'`
|
||||
if [ "$LINK" = 'link:up' ]; then
|
||||
return 0
|
||||
else
|
||||
|
|
|
@ -3,3 +3,4 @@ config wifi-sentinel
|
|||
option packets 3
|
||||
option interval 10
|
||||
option network 'management'
|
||||
option switchport '1'
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
config wifi-sentinel
|
||||
option packets 3
|
||||
option interval 10
|
||||
option network 'management'
|
||||
option switchport '2'
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
config wifi-sentinel
|
||||
option packets 3
|
||||
option interval 10
|
||||
option network 'management'
|
||||
option switchport '1'
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
config wifi-sentinel
|
||||
option packets 3
|
||||
option interval 10
|
||||
option network 'management'
|
||||
option switchport '1'
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
config wifi-sentinel
|
||||
option packets 3
|
||||
option interval 10
|
||||
option network 'management'
|
||||
option switchport '1'
|
Loading…
Reference in New Issue