gluon-core: add functions to unset sysconfig settings
This commit is contained in:
parent
f6a51c63e4
commit
2ec02a41c2
@ -12,3 +12,7 @@ sysconfig_isset() {
|
|||||||
sysconfig_set() {
|
sysconfig_set() {
|
||||||
echo -n "$2" > "$SYSCONFIGDIR/$1"
|
echo -n "$2" > "$SYSCONFIGDIR/$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sysconfig_unset() {
|
||||||
|
rm -f "$SYSCONFIGDIR/$1"
|
||||||
|
}
|
||||||
|
@ -11,10 +11,13 @@ local function get(_, name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function set(_, name, val)
|
local function set(_, name, val)
|
||||||
local ret = nil
|
if val then
|
||||||
local f = io.open(sysconfigdir .. name, 'w+')
|
local f = io.open(sysconfigdir .. name, 'w+')
|
||||||
f:write(val)
|
f:write(val)
|
||||||
f:close()
|
f:close()
|
||||||
|
else
|
||||||
|
os.remove(sysconfigdir .. name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
|
Loading…
Reference in New Issue
Block a user