diff --git a/swap-management/autoswap.service b/swap-management/autoswap.service index 78ae308..707707b 100644 --- a/swap-management/autoswap.service +++ b/swap-management/autoswap.service @@ -1,5 +1,5 @@ [Unit] -Description=Auto SWAP Service v1.0 (Bash Version) +Description=Auto SWAP Service v1.01 (Bash Version) [Service] ExecStart=/autoswap.sh diff --git a/swap-management/autoswap.sh b/swap-management/autoswap.sh index e1643c4..8a6890c 100644 --- a/swap-management/autoswap.sh +++ b/swap-management/autoswap.sh @@ -1,7 +1,7 @@ #!/bin/bash ## autoswap.sh -## version 1.0 +## version 1.01 ## Automatically add and remove SWAP files based on system load. ## Author: Ze'ev Schurmann @@ -124,10 +124,10 @@ fi swap_file_size_gb=$(($swap_file_size/1024)) -if [[ $(($swap_file_size%1024)) -eq 0 ]]; then +if [[ $(($swap_file_size%1024)) != 0 ]]; then echolog "Converting {swap_file_size} from MB to GB, rounding up..." ((swap_file_size_gb++)) - swap_file_size=$(($swap_file_size_gb*1014)) + swap_file_size=$(($swap_file_size_gb*1024)) fi echolog "{threshold_minimum} = ${threshold_minimum}MB"