From ca8940b86021055f375b837aa40bd6580770eb05 Mon Sep 17 00:00:00 2001 From: ewilly Date: Sun, 13 Feb 2022 21:03:23 +0100 Subject: [PATCH] Avoid grep issue with vmstat command due to localized vmstat in bullseye --- helpers/hardware | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helpers/hardware b/helpers/hardware index 9f276b806..337630fa8 100644 --- a/helpers/hardware +++ b/helpers/hardware @@ -30,8 +30,8 @@ ynh_get_ram() { ram=0 # Use the total amount of ram elif [ $free -eq 1 ]; then - local free_ram=$(vmstat --stats --unit M | grep "free memory" | awk '{print $1}') - local free_swap=$(vmstat --stats --unit M | grep "free swap" | awk '{print $1}') + local free_ram=$(LANG=C vmstat --stats --unit M | grep "free memory" | awk '{print $1}') + local free_swap=$(LANG=C vmstat --stats --unit M | grep "free swap" | awk '{print $1}') local free_ram_swap=$((free_ram + free_swap)) # Use the total amount of free ram @@ -44,8 +44,8 @@ ynh_get_ram() { ram=$free_swap fi elif [ $total -eq 1 ]; then - local total_ram=$(vmstat --stats --unit M | grep "total memory" | awk '{print $1}') - local total_swap=$(vmstat --stats --unit M | grep "total swap" | awk '{print $1}') + local total_ram=$(LANG=C vmstat --stats --unit M | grep "total memory" | awk '{print $1}') + local total_swap=$(LANG=C vmstat --stats --unit M | grep "total swap" | awk '{print $1}') local total_ram_swap=$((total_ram + total_swap)) local ram=$total_ram_swap