feature: add advanced config option to purge AREDN Alert (and local alert) messages (#76)

This commit is contained in:
dman776 2021-03-12 16:28:14 -06:00 committed by GitHub
parent 89f110866f
commit 4b86b4f02a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -154,7 +154,13 @@ push @setting, {
desc => "Specifies the URL of the location from which local AREDN Alerts can be downloaded.",
default => ""
};
push @setting, {
key => "aredn.aam.purge",
type => "boolean",
desc => "Value doesn't matter. Will immediately purge/delete all AREDN (and local) Alerts from this node.",
default => "",
postcallback => "alert_purge()"
};
# ----------------------------------------
# ----- CONDITIONS ----------
@ -199,6 +205,13 @@ sub aam_refresh()
return $rc;
}
sub alert_purge()
{
unlink("/tmp/aredn_message");
unlink("/tmp/local_message");
return 0;
}
sub writePackageRepo {
my $repo = @_[0];
my $uciurl = `uci get aredn.\@downloads[0].pkgs_$repo`;