Modify for sysctl config persistent.

This commit is contained in:
samson 2018-12-03 02:43:43 +08:00
parent 8d8848da16
commit ff5447d2fb
1 changed files with 1 additions and 0 deletions

View File

@ -34,6 +34,7 @@ set_sysctl_param() {
local VALUE=$2 local VALUE=$2
debug "Setting $SYSCTL_PARAM to $VALUE" debug "Setting $SYSCTL_PARAM to $VALUE"
if [ "$(sysctl -w $SYSCTL_PARAM=$VALUE 2>/dev/null)" = "$SYSCTL_PARAM = $VALUE" ]; then if [ "$(sysctl -w $SYSCTL_PARAM=$VALUE 2>/dev/null)" = "$SYSCTL_PARAM = $VALUE" ]; then
echo "$SYSCTL_PARAM = $VALUE" >> /etc/sysctl.conf
FNRET=0 FNRET=0
elif [ $? = 255 ]; then elif [ $? = 255 ]; then
debug "$SYSCTL_PARAM does not exist" debug "$SYSCTL_PARAM does not exist"