mirror of
https://github.com/darksaid98/ubuntu-server-setup.git
synced 2026-12-01 14:38:58 +00:00
Fixed bug with saving swap settings
This commit is contained in:
1 parent
803b2ce2eb
commit
febdd604b5
2 files changed
+9
-3
No files matched your search
@@ -57,7 +57,7 @@ function setupSwap() {
|
||||
createSwap
|
||||
mountSwap
|
||||
tweakSwapSettings "10" "50"
|
||||
saveSwapSettings
|
||||
saveSwapSettings "10" "50"
|
||||
}
|
||||
|
||||
function hasSwap() {
|
||||
|
||||
+8
-2
@@ -91,9 +91,15 @@ function tweakSwapSettings() {
|
||||
}
|
||||
|
||||
# Save the modified swap settings
|
||||
# Arguments:
|
||||
# new vm.swappiness value
|
||||
# new vm.vfs_cache_pressure value
|
||||
function saveSwapSettings() {
|
||||
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
|
||||
echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf
|
||||
local swappiness=${1}
|
||||
local vfs_cache_pressure=${2}
|
||||
|
||||
echo "vm.swappiness=${swappiness}" | sudo tee -a /etc/sysctl.conf
|
||||
echo "vm.vfs_cache_pressure=${vfs_cache_pressure}" | sudo tee -a /etc/sysctl.conf
|
||||
}
|
||||
|
||||
# Set the machine's timezone
|
||||
|
||||
Reference in new issue
Block a user