mirror of
https://github.com/the-sane/lug-helper.git
synced 2024-12-28 16:54:23 +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
|
# Check system memory and swap space
|
||||||
memory_check() {
|
memory_check() {
|
||||||
# Get totals in bytes
|
# Get totals in KB
|
||||||
memtotal="$(LC_NUMERIC=C awk '/MemTotal/ {printf $2*1024}' /proc/meminfo)"
|
memtotal="$(LC_NUMERIC=C awk '/MemTotal/ {printf $2}' /proc/meminfo)"
|
||||||
swaptotal="$(LC_NUMERIC=C awk '/SwapTotal/ {printf $2*1024}' /proc/meminfo)"
|
swaptotal="$(LC_NUMERIC=C awk '/SwapTotal/ {printf $2}' /proc/meminfo)"
|
||||||
|
memtotal="$(($memtotal * 1024))"
|
||||||
|
swaptotal="$(($swaptotal * 1024))"
|
||||||
combtotal="$(($memtotal + $swaptotal))"
|
combtotal="$(($memtotal + $swaptotal))"
|
||||||
|
|
||||||
# Convert to GiB
|
# Convert to GiB
|
||||||
|
Loading…
Reference in New Issue
Block a user