Skip to content
Snippets Groups Projects
Commit da03d133 authored by Rob Swindell's avatar Rob Swindell :speech_balloon: Committed by Deucе
Browse files

Add Trashman as Monthly system/fixed event, if there isn't one

This'll keep your ip.can and spamblock.cfg files maintained.
parent a772f426
Branches
Tags
No related merge requests found
......@@ -91,8 +91,10 @@ function install_logonlist()
if(!f.open(f.exists ? 'r+':'w+'))
return "!Failed to open " + f.name;
var cmd = f.iniGetValue("daily_event", "cmd");
if(cmd)
if(cmd) {
f.close();
return format("System daily event already set to: '%s'", cmd);
}
var result = f.iniSetValue("daily_event", "cmd", maint_event);
f.close();
if(!result)
......@@ -100,6 +102,25 @@ function install_logonlist()
return "Successful";
}
function install_trashman()
{
const section = "monthly_event";
var f = new File(system.ctrl_dir + "main.ini");
if(!f.open(f.exists ? 'r+':'w+'))
return "!Failed to open " + f.name;
var cmd = f.iniGetValue(section, "cmd");
if(cmd) {
f.close();
return format("System monthly event already set to: '%s'", cmd);
}
var result = f.iniSetValue(section, "cmd", "%!trashman%. %z*.can %kspamblock.cfg");
result = result && f.iniSetValue(section, "settings", "0x4001");
f.close();
if(!result)
return "!Failed to write main.ini";
return "Successful";
}
function base_filename(fullname)
{
var ext = file_getext(fullname);
......@@ -184,7 +205,8 @@ if(!xtrn_area.prog["avatchoo"] && !xtrn_area.event["avat-out"]) {
js.exec("avatars.js", {}, "install");
}
print("Installing Logon List module: " + install_logonlist());
print("Installing Logon List Daily Event: " + install_logonlist());
print("Installing Trashman Monthly Event: " + install_trashman());
print("Updating [General] Text File Section indexes");
print(update_gfile_indexes() + " indexes updated.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment