mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Remove swap2ram.sh
This commit is contained in:
parent
ee4091adab
commit
e68bca293a
@ -1,26 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Syntax: ./swap2ram
|
||||
# Description: swaps back to RAM
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
# NOTE: for automation copy this script to /etc/cron.daily
|
||||
|
||||
if ! [ $(id -u) = 0 ]; then
|
||||
echo "Please run this script as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SwapUsed=$(LC_ALL=C free --human --si | awk '/Swap:/ {print $3}')
|
||||
RAMsize=$(LC_ALL=C free --human --si | awk '/Mem:/ {print $2}')
|
||||
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 back to RAM ($RAMsize total, $RAMused used, $RAMfree free) ... "
|
||||
start=`date +%s`
|
||||
swapoff -a && swapon -a
|
||||
end=`date +%s`
|
||||
|
||||
echo "DONE (`expr $end - $start` sec.)"
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user