From 17185b498fea2f2f91c409b27df00bca8363e693 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 16 Oct 2025 08:52:45 +0000 Subject: [PATCH] Normalize storage pool locale handling (#562) --- install.sh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index 76c4392a6..3495108ff 100755 --- a/install.sh +++ b/install.sh @@ -576,12 +576,11 @@ create_lxc_container() { local idx=1 while IFS= read -r line; do - local storage_name=$(echo "$line" | awk '{print $1}') - local storage_type=$(echo "$line" | awk '{print $2}') - local avail_gb=$(echo "$line" | awk '{print $6/1048576}') - local total_gb=$(echo "$line" | awk '{print $4/1048576}') - local used_pct=$(echo "$line" | awk '{print $7}') - + local storage_name storage_type avail_gb total_gb used_pct parsed_line + parsed_line=$(LC_NUMERIC=C awk '{printf "%s,%s,%.1f,%.1f,%s", $1, $2, $6/1048576, $4/1048576, $7}' <<< "$line") + [[ -z "$parsed_line" ]] && continue + IFS=',' read -r storage_name storage_type avail_gb total_gb used_pct <<< "$parsed_line" || continue + storage_names+=("$storage_name") LC_ALL=C printf " %d) %-15s %-8s %6.1f GB free of %6.1f GB (%s used)\n" \ "$idx" "$storage_name" "$storage_type" "$avail_gb" "$total_gb" "$used_pct" @@ -716,12 +715,11 @@ create_lxc_container() { local idx=1 while IFS= read -r line; do - local storage_name=$(echo "$line" | awk '{print $1}') - local storage_type=$(echo "$line" | awk '{print $2}') - local avail_gb=$(echo "$line" | awk '{print $6/1048576}') - local total_gb=$(echo "$line" | awk '{print $4/1048576}') - local used_pct=$(echo "$line" | awk '{print $7}') - + local storage_name storage_type avail_gb total_gb used_pct parsed_line + parsed_line=$(LC_NUMERIC=C awk '{printf "%s,%s,%.1f,%.1f,%s", $1, $2, $6/1048576, $4/1048576, $7}' <<< "$line") + [[ -z "$parsed_line" ]] && continue + IFS=',' read -r storage_name storage_type avail_gb total_gb used_pct <<< "$parsed_line" || continue + storage_names+=("$storage_name") LC_ALL=C printf " %d) %-15s %-8s %6.1f GB free of %6.1f GB (%s used)\n" \ "$idx" "$storage_name" "$storage_type" "$avail_gb" "$total_gb" "$used_pct"