mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-13 15:15:38 +00:00
Normalize storage pool locale handling (#562)
This commit is contained in:
parent
c15a87b43e
commit
17185b498f
1 changed files with 10 additions and 12 deletions
22
install.sh
22
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue