Skip to content

Commit 75e10fc

Browse files
committed
[Fix] if test condition syntax error in email_panel_user
[Fix] email_panel_user not cleaning up temporary files
1 parent 85f12d5 commit 75e10fc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

files/internals/functions

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ genalert() {
15221522
fi
15231523
fi
15241524
elif [ "$type" == "panel" ] && [ -f "$file" ]; then
1525-
eout "{panel} Detecting control panel and sending alerts..." 1
1525+
eout "{panel} Detecting control panel and sending alerts..." 1
15261526
control_panel=""
15271527
detect_control_panel
15281528
if [ "$control_panel" == "error" ] || [ "$control_panel" == "unknown" ]; then
@@ -1552,7 +1552,7 @@ genalert() {
15521552
# Determine control panel, noop if error or none detected
15531553
eout "{panel} Detected control panel $control_panel. Will send alerts to control panel account contacts." 1
15541554
user_list=$(awk '{print $1}' $tmpdir/.panel_alert.hits | sort | uniq)
1555-
if [ -n "$user_list"]; then
1555+
if [ -n "$user_list" ]; then
15561556
for sys_user in $user_list; do
15571557
contact_emails=""
15581558
get_panel_contacts $control_panel $sys_user
@@ -1581,7 +1581,8 @@ genalert() {
15811581
eout "{panel} No compatible \$sendmail or \$mail binaries found, control panel account alerts disabled."
15821582
fi
15831583
done
1584-
fi
1584+
fi
1585+
rm -f $tmpdir/.panel_alert.hits $tmpdir/.panel_alert.clean $tmpdir/.${sys_user}.hits $tmpdir/.${sys_user}.clean $tmpf
15851586
fi
15861587
elif [ "$type" == "daily" ] || [ "$type" == "digest" ]; then
15871588
inotify_start_time=`ps -p $(ps -A -o 'pid cmd' | grep -E maldetect | grep -E inotifywait | awk '{print$1}' | head -n1) -o lstart= 2> /dev/null`

0 commit comments

Comments
 (0)