Bump to next branch

Host: Ubuntu 21.04
This commit is contained in:
orangepi-xunlong
2022-03-07 16:26:01 +08:00
parent 812e231da2
commit 206214916c
615 changed files with 61837 additions and 2426 deletions

View File

@@ -1071,26 +1071,26 @@ NetworkMonitorMode() {
# Allow orangepimonitor to return back to orangepi-config
trap "echo ; exit 0" 0 1 2 3 15
timerStart
kickAllStatsDown
# Count interfaces - multiple routes causing interfaces to show up more than once, filtering...
ifacecount=$(route -n | egrep UG | egrep -o "[a-zA-Z0-9]*$" | sort | uniq)
ifacecount=$(route -n | egrep UG | egrep -o '[^ ]*$' | sort | uniq)
# If there are two ore more interfaces detected open a dynamic dialog box to select which to monitor
if [ "$(echo -e $ifacecount | tr ' ' '\n' | wc -l)" -gt 1 ]; then
ifacemenu=$(route -n | egrep UG | egrep -o "[a-zA-Z0-9]*$" | sort | uniq | awk '{a[$1]=$1}END{for(i in a)printf i" "a[i]" "}')
ifacemenu=$(route -n | egrep UG | egrep -o '[^ ]*$' | sort | uniq | awk '{a[$1]=$1}END{for(i in a)printf i" "a[i]" "}')
ifacefunc() {
dialog --backtitle "Interface selector" \
--title "Multiple network interfaces detected" \
--menu "Choose which interface to monitor:" \
15 50 $(route -n | egrep UG | egrep -o "[a-zA-Z0-9]*$" | sort | uniq | wc -l) \
15 50 $(route -n | egrep UG | egrep -o '[^ ]*$' | sort | uniq | wc -l) \
$(echo $ifacemenu) 2>&1 >$(tty)
}
iface=$(ifacefunc)
else
# Use default behavior if one interface is found only
iface=$(route -n | egrep UG | egrep -o "[a-zA-Z0-9]*$")
iface=$(route -n | egrep UG | egrep -o '[^ ]*$')
fi
timerStart
kickAllStatsDown
printf "\nruntime network statistics: $(uname -n)\n"
printf "network interface: $(echo $iface)\n"