mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-27 18:33:19 +01:00
13 lines
253 B
Plaintext
13 lines
253 B
Plaintext
|
#!/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
|