mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 01:48:20 +02:00
Improved swap2ram
This commit is contained in:
parent
dad0a13e08
commit
676a0898a7
@ -12,11 +12,12 @@ if ! [ $(id -u) = 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SwapUsed=$(LC_ALL=C free | awk '/Swap:/ {print $3}')
|
SwapUsed=$(LC_ALL=C free --human --si | awk '/Swap:/ {print $3}')
|
||||||
RAMsize=$(LC_ALL=C free | awk '/Mem:/ {print $2}')
|
RAMsize=$(LC_ALL=C free --human --si | awk '/Mem:/ {print $2}')
|
||||||
RAMfree=$(LC_ALL=C free | awk '/Mem:/ {print $4}')
|
RAMused=$(LC_ALL=C free --human --si | awk '/Mem:/ {print $3}')
|
||||||
|
RAMfree=$(LC_ALL=C free --human --si | awk '/Mem:/ {print $4}')
|
||||||
|
|
||||||
printf "Swapping $SwapUsed bytes back to RAM ($RAMfree bytes free of $RAMsize bytes total) ... "
|
printf "Swapping $SwapUsed back to RAM ($RAMsize total, $RAMused used, $RAMfree free) ... "
|
||||||
start=`date +%s`
|
start=`date +%s`
|
||||||
swapoff -a && swapon -a
|
swapoff -a && swapon -a
|
||||||
end=`date +%s`
|
end=`date +%s`
|
||||||
|
Loading…
Reference in New Issue
Block a user