Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WAPFILENAME=/swap.img
- MEMSIZE=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'`
- if [ $MEMSIZE -lt 2097152 ]; then
- SIZE=$(($MEMSIZE * 2))k
- elif [ $MEMSIZE -lt 8388608 ]; then
- SIZE=${MEMSIZE}k
- elif [ $MEMSIZE -lt 67108864 ]; then
- SIZE=$(($MEMSIZE / 2))k
- else
- SIZE=4194304k
- fi
- fallocate -l $SIZE $SWAPFILENAME && mkswap $SWAPFILENAME && swapon $SWAPFILENAME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement