mirror of
https://github.com/darksaid98/ubuntu-server-setup.git
synced 2026-12-02 22:23:30 +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
|
createSwap
|
||||||
mountSwap
|
mountSwap
|
||||||
tweakSwapSettings "10" "50"
|
tweakSwapSettings "10" "50"
|
||||||
saveSwapSettings
|
saveSwapSettings "10" "50"
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasSwap() {
|
function hasSwap() {
|
||||||
|
|||||||
+8
-2
@@ -91,9 +91,15 @@ function tweakSwapSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Save the modified swap settings
|
# Save the modified swap settings
|
||||||
|
# Arguments:
|
||||||
|
# new vm.swappiness value
|
||||||
|
# new vm.vfs_cache_pressure value
|
||||||
function saveSwapSettings() {
|
function saveSwapSettings() {
|
||||||
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
|
local swappiness=${1}
|
||||||
echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf
|
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
|
# Set the machine's timezone
|
||||||
|
|||||||
Reference in new issue
Block a user