1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-27 04:18:05 +11:00

replaced a bunch of different configuration options in the minitel daemon with a single command

This commit is contained in:
Izaya 2018-07-28 05:52:37 +10:00
parent b212d13010
commit 276c8f125e
2 changed files with 25 additions and 24 deletions

View File

@ -121,9 +121,17 @@ function stop()
end end
function set(k,v) function set(k,v)
if cfg[k] then if type(cfg[k]) == "string" then
cfg[k] = v cfg[k] = v
print("cfg."..k.." = "..v) elseif type(cfg[k]) == "number" then
cfg[k] = tonumber(v)
elseif type(cfg[k]) == "boolean" then
if v:lower():sub(1,1) == "t" then
cfg[k] = true
else
cfg[k] = false
end end
end
print("cfg."..k.." = "..tostring(cfg[k]))
writeConfig() writeConfig()
end end

View File

@ -241,29 +241,22 @@ function stop()
end end
end end
function debug() function set(k,v)
cfg.debug = not cfg.debug if type(cfg[k]) == "string" then
end cfg[k] = v
function set_retry(sn) elseif type(cfg[k]) == "number" then
cfg.retry = tonumber(sn) or 30 cfg[k] = tonumber(v)
print("retry = "..tostring(cfg.retry)) elseif type(cfg[k]) == "boolean" then
end if v:lower():sub(1,1) == "t" then
function set_retrycount(sn) cfg[k] = true
cfg.retrycount = tonumber(sn) or 64 else
print("retrycount = "..tostring(cfg.retrycount)) cfg[k] = false
end end
function set_pctime(sn) end
cfg.pctime = tonumber(sn) or 30 print("cfg."..k.." = "..tostring(cfg[k]))
print("pctime = "..tostring(cfg.pctime)) writeConfig()
end
function set_rctime(sn)
cfg.rctime = tonumber(sn) or 30
print("rctime = "..tostring(cfg.rctime))
end
function set_port(sn)
cfg.port = tonumber(sn) or 4096
print("port = "..tostring(cfg.port))
end end
function set_route(to,laddr,raddr) function set_route(to,laddr,raddr)
cfg.sroutes[to] = {laddr,raddr,0} cfg.sroutes[to] = {laddr,raddr,0}
end end