mirror of
https://github.com/armbian/build.git
synced 2025-08-25 08:21:10 +02:00
More motd related fixed (#2848)
Fixing error when we don't have etherned
This commit is contained in:
parent
e78cb4ce2a
commit
f7c2dc2bc3
@ -7,7 +7,7 @@
|
||||
MOTD_DISABLE=""
|
||||
ONE_WIRE=""
|
||||
SHOW_IP_PATTERN="^bond.*|^[ewr].*|^br.*|^lt.*|^umts.*|^lan.*"
|
||||
PRIMARY_INTERFACE="$(ls -1 /sys/class/net/ | grep -v lo | egrep "enp|eth" | sed -n -e 'H;${x;s/\n/+/g;s/^+//;p;}')"
|
||||
PRIMARY_INTERFACE="$(ls -1 /sys/class/net/ | grep -v lo | egrep "enp|eth" | head -1)"
|
||||
PRIMARY_DIRECTION="rx"
|
||||
STORAGE=/dev/sda1
|
||||
|
||||
|
@ -233,7 +233,7 @@ display "Battery" "$battery_percent" "20" "1" "%" "$status_battery_text" ; a=$((
|
||||
(( $a > 0 )) && echo "" # new line only if some value is displayed
|
||||
|
||||
line=0
|
||||
if [[ $(command -v vnstat) ]]; then
|
||||
if [[ $(command -v vnstat) && -n $PRIMARY_INTERFACE ]]; then
|
||||
traffic=$(vnstat -i $PRIMARY_INTERFACE --oneline | cut -d";" -f4,5)
|
||||
traffic_rx=$(echo $traffic | cut -d";" -f1,1 | sed -r 's/([0-9]+\.[0-9]{1})[0-9]*/\1/')
|
||||
traffic_tx=$(echo $traffic | cut -d";" -f2,2 | sed -r 's/([0-9]+\.[0-9]{1})[0-9]*/\1/')
|
||||
|
Loading…
x
Reference in New Issue
Block a user