From: Stefan Schantl Date: Mon, 21 Mar 2022 19:21:21 +0000 (+0100) Subject: ids-functions.pl: Remove temporary file, if the download failed. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=304ce130fd1e19de6a4faf9834784e0d821c02c1;p=people%2Fstevee%2Fipfire-2.x.git ids-functions.pl: Remove temporary file, if the download failed. Signed-off-by: Stefan Schantl --- diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 29d1869955..90b7d2d7f0 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -393,6 +393,9 @@ sub downloadruleset ($) { return 1; } + # Remove temporary file, if one exists. + unlink("$tmpfile") if (-e "$tmpfile"); + # Increase download attempt counter. $dl_attempt++; }