From 05c2cb911b293c073f05e05a11ba309b5dbb1137 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sat, 28 Oct 2017 15:40:24 -0500 Subject: [PATCH] Improve sysctl settings - Fix kernel.shmmax and kernel.shmall on 32-bit Linux. Thanks @komanshidaruma! - Clean up other sysctl settings --- vpnsetup.sh | 24 +++++++++++++----------- vpnsetup_centos.sh | 24 +++++++++++++----------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/vpnsetup.sh b/vpnsetup.sh index d61db85..c6335be 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -335,30 +335,32 @@ bigecho "Updating sysctl settings..." if ! grep -qs "hwdsl2 VPN script" /etc/sysctl.conf; then conf_bk "/etc/sysctl.conf" + if [ "$(getconf LONG_BIT)" = "64" ]; then + SHM_MAX=68719476736 + SHM_ALL=4294967296 + else + SHM_MAX=4294967295 + SHM_ALL=268435456 + fi cat >> /etc/sysctl.conf <> /etc/sysctl.conf <