mirror of
https://github.com/YunoHost-Apps/monitorix_ynh.git
synced 2024-09-03 19:46:06 +02:00
Net interface - Set speed to 1000 if -1 is returned
This commit is contained in:
parent
42e9bdef0c
commit
be52f3a414
1 changed files with 3 additions and 0 deletions
|
@ -33,6 +33,9 @@ home_dir_filter() {
|
||||||
interface_speed_map() {
|
interface_speed_map() {
|
||||||
while read -r item; do
|
while read -r item; do
|
||||||
speed=$(cat /sys/class/net/"$item"/speed 2>/dev/null || echo 1000)
|
speed=$(cat /sys/class/net/"$item"/speed 2>/dev/null || echo 1000)
|
||||||
|
if [ "$speed" == -1 ]; then
|
||||||
|
speed=1000
|
||||||
|
fi
|
||||||
echo "$item,$speed"
|
echo "$item,$speed"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue