Skip to content
Snippets Groups Projects
Commit 2ec02a41 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: add functions to unset sysconfig settings

parent f6a51c63
No related branches found
No related tags found
No related merge requests found
......@@ -12,3 +12,7 @@ sysconfig_isset() {
sysconfig_set() {
echo -n "$2" > "$SYSCONFIGDIR/$1"
}
sysconfig_unset() {
rm -f "$SYSCONFIGDIR/$1"
}
......@@ -11,10 +11,13 @@ local function get(_, name)
end
local function set(_, name, val)
local ret = nil
local f = io.open(sysconfigdir .. name, 'w+')
f:write(val)
f:close()
if val then
local f = io.open(sysconfigdir .. name, 'w+')
f:write(val)
f:close()
else
os.remove(sysconfigdir .. name)
end
end
local setmetatable = setmetatable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment