Skip to content
Snippets Groups Projects
Commit c7d68d59 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Update method of setting daily_event for main.ini (not main.cnf)

parent 20e2364f
No related branches found
No related tags found
No related merge requests found
...@@ -87,15 +87,16 @@ function update_birthdates() ...@@ -87,15 +87,16 @@ function update_birthdates()
function install_logonlist() function install_logonlist()
{ {
var maint_event = "?logonlist -m"; var maint_event = "?logonlist -m";
var cnflib = load({}, "cnflib.js"); var f = new File(system.ctrl_dir + "main.ini");
var main_cnf = cnflib.read("main.cnf"); if(!f.open(f.exists ? 'r+':'w+'))
if(!main_cnf) return "!Failed to open " + f.name;
return "!Failed to read main.cnf"; var cmd = f.iniGetValue("daily_event", "cmd");
if(main_cnf.sys_daily) if(cmd)
return format("System daily event already set to: '%s'", main_cnf.sys_daily); return format("System daily event already set to: '%s'", cmd);
main_cnf.sys_daily = maint_event; var result = f.iniSetValue("daily_event", "cmd", maint_event);
if(!cnflib.write("main.cnf", undefined, main_cnf)) f.close();
return "!Failed to write main.cnf"; if(!result)
return "!Failed to write main.ini";
return "Successful"; return "Successful";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment