v1.01 of autoswap.sh - Fixed bug correcting SWAP file sizes.
This commit is contained in:
parent
5b9cad82b3
commit
19ce92eb78
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue