From 4b86b4f02a407eba283e9ccd7326b3a8c7c6189b Mon Sep 17 00:00:00 2001 From: dman776 Date: Fri, 12 Mar 2021 16:28:14 -0600 Subject: [PATCH] feature: add advanced config option to purge AREDN Alert (and local alert) messages (#76) --- files/www/cgi-bin/advancedconfig | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/files/www/cgi-bin/advancedconfig b/files/www/cgi-bin/advancedconfig index 1f178dbb..fa2c018c 100755 --- a/files/www/cgi-bin/advancedconfig +++ b/files/www/cgi-bin/advancedconfig @@ -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`;