mirror of
https://github.com/the-sane/lug-helper.git
synced 2024-12-27 09:04:19 +00:00
awk can't always be trusted for math (mawk bad)
This commit is contained in:
parent
4618dfed61
commit
c4d5a5a3dd
@ -901,9 +901,11 @@ winetricks_check() {
|
||||
|
||||
# Check system memory and swap space
|
||||
memory_check() {
|
||||
# Get totals in bytes
|
||||
memtotal="$(LC_NUMERIC=C awk '/MemTotal/ {printf $2*1024}' /proc/meminfo)"
|
||||
swaptotal="$(LC_NUMERIC=C awk '/SwapTotal/ {printf $2*1024}' /proc/meminfo)"
|
||||
# Get totals in KB
|
||||
memtotal="$(LC_NUMERIC=C awk '/MemTotal/ {printf $2}' /proc/meminfo)"
|
||||
swaptotal="$(LC_NUMERIC=C awk '/SwapTotal/ {printf $2}' /proc/meminfo)"
|
||||
memtotal="$(($memtotal * 1024))"
|
||||
swaptotal="$(($swaptotal * 1024))"
|
||||
combtotal="$(($memtotal + $swaptotal))"
|
||||
|
||||
# Convert to GiB
|
||||
|
Loading…
Reference in New Issue
Block a user