From d2373590e03d9f2002b77fac2ae33459e2ec51db Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 30 Nov 2016 19:38:05 +0100 Subject: [PATCH] gluon-core: add support for removing sysctl settings --- package/gluon-core/luasrc/usr/lib/lua/gluon/sysctl.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/sysctl.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/sysctl.lua index 44b0c217..ee429437 100644 --- a/package/gluon-core/luasrc/usr/lib/lua/gluon/sysctl.lua +++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/sysctl.lua @@ -4,5 +4,9 @@ local util = require 'gluon.util' module 'gluon.sysctl' function set(name, value) - util.replace_prefix('/etc/sysctl.conf', name .. '=', name .. '=' .. value .. '\n') + local new + if value then + new = name .. '=' .. value .. '\n' + end + util.replace_prefix('/etc/sysctl.conf', name .. '=', new) end