swap for -gt 128

Now we are considering cases for swap with ram above 128.
This commit is contained in:
Cristhian Martínez Ochoa 2018-05-18 14:19:24 -06:00
parent 4088125ee0
commit e7b3d36419

View file

@ -431,7 +431,8 @@ swap_create() {
swap_delete
swapkb=$(grep SwapTotal /proc/meminfo | cut -f 2 -d ':' | tr -d ' ' | cut -f 1 -d 'k')
fi
# https://help.ubuntu.com/community/SwapFaq
if [[ -z $swapkb || $swapkb == "0" ]]; then
if [[ -n $(conf_read swap-mem) && $(conf_read swap-mem) =~ ^[0-9]+$ ]]; then
local newswap=$(conf_read swap-mem)
@ -451,6 +452,8 @@ swap_create() {
local newswap="8"
elif [[ $ram -le 128 ]]; then
local newswap="11"
elif [[ $ram -gt 128 ]]; then
local newswap="15"
else
local newswap="0"
fi