mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
First version for oled
This commit is contained in:
parent
61b9901edb
commit
6fa256c456
10 changed files with 364 additions and 172 deletions
26
luci-app-ouad/root/usr/sbin/status_interfaces.sh
Executable file
26
luci-app-ouad/root/usr/sbin/status_interfaces.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
alldata=$(ubus call openmptcprouter status)
|
||||
labels=$(echo $alldata | jsonfilter -e '@.wans[@.multipath!="off"].label')
|
||||
for wan in $labels; do
|
||||
wandata=$(echo $alldata | jsonfilter -e "@.wans[@.label=\"${wan}\"]")
|
||||
status=$(echo $wandata | jsonfilter -e '@.status')
|
||||
signal=$(echo $wandata | jsonfilter -e '@.signal')
|
||||
echo -n "$wan $status "
|
||||
if [ "$signal" != "" ]; then
|
||||
if [ "$signal" -eq "0" ]; then
|
||||
echo -n "0/4"
|
||||
elif [ "$signal" -lt "25" ]; then
|
||||
echo -n "1/4"
|
||||
elif [ "$signal" -lt "50" ]; then
|
||||
echo -n "2/4"
|
||||
elif [ "$signal" -lt "75" ]; then
|
||||
echo -n "3/4"
|
||||
else
|
||||
echo -n "4/4"
|
||||
fi
|
||||
else
|
||||
echo -n "$(echo $wandata | jsonfilter -e '@.state')"
|
||||
fi
|
||||
echo
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue