Skip to content

Commit febdd60

Browse files
committed
Fixed bug with saving swap settings
1 parent 803b2ce commit febdd60

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function setupSwap() {
5757
createSwap
5858
mountSwap
5959
tweakSwapSettings "10" "50"
60-
saveSwapSettings
60+
saveSwapSettings "10" "50"
6161
}
6262

6363
function hasSwap() {

setupLibrary.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,15 @@ function tweakSwapSettings() {
9191
}
9292

9393
# Save the modified swap settings
94+
# Arguments:
95+
# new vm.swappiness value
96+
# new vm.vfs_cache_pressure value
9497
function saveSwapSettings() {
95-
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
96-
echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf
98+
local swappiness=${1}
99+
local vfs_cache_pressure=${2}
100+
101+
echo "vm.swappiness=${swappiness}" | sudo tee -a /etc/sysctl.conf
102+
echo "vm.vfs_cache_pressure=${vfs_cache_pressure}" | sudo tee -a /etc/sysctl.conf
97103
}
98104

99105
# Set the machine's timezone

0 commit comments

Comments
 (0)