mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-16 05:24:59 +02:00
Added swap2ram
This commit is contained in:
parent
08295b989b
commit
fed6df1977
12
Scripts/swap2ram
Executable file
12
Scripts/swap2ram
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mem=$(LC_ALL=C free | awk '/Mem:/ {print $4}')
|
||||||
|
swap=$(LC_ALL=C free | awk '/Swap:/ {print $3}')
|
||||||
|
|
||||||
|
if [ $mem -lt $swap ]; then
|
||||||
|
echo "ERROR: not enough RAM to write swap back, nothing done" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
swapoff -a && swapon -a
|
||||||
|
exit 0
|
Loading…
Reference in New Issue
Block a user