Skip to content

Commit

Permalink
[Fix] if test condition syntax error in email_panel_user
Browse files Browse the repository at this point in the history
[Fix] email_panel_user not cleaning up temporary files
  • Loading branch information
rfxn committed Apr 8, 2023
1 parent 85f12d5 commit 75e10fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions files/internals/functions
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ genalert() {
fi
fi
elif [ "$type" == "panel" ] && [ -f "$file" ]; then
eout "{panel} Detecting control panel and sending alerts..." 1
eout "{panel} Detecting control panel and sending alerts..." 1
control_panel=""
detect_control_panel
if [ "$control_panel" == "error" ] || [ "$control_panel" == "unknown" ]; then
Expand Down Expand Up @@ -1552,7 +1552,7 @@ genalert() {
# Determine control panel, noop if error or none detected
eout "{panel} Detected control panel $control_panel. Will send alerts to control panel account contacts." 1
user_list=$(awk '{print $1}' $tmpdir/.panel_alert.hits | sort | uniq)
if [ -n "$user_list"]; then
if [ -n "$user_list" ]; then
for sys_user in $user_list; do
contact_emails=""
get_panel_contacts $control_panel $sys_user
Expand Down Expand Up @@ -1581,7 +1581,8 @@ genalert() {
eout "{panel} No compatible \$sendmail or \$mail binaries found, control panel account alerts disabled."
fi
done
fi
fi
rm -f $tmpdir/.panel_alert.hits $tmpdir/.panel_alert.clean $tmpdir/.${sys_user}.hits $tmpdir/.${sys_user}.clean $tmpf
fi
elif [ "$type" == "daily" ] || [ "$type" == "digest" ]; then
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`
Expand Down

0 comments on commit 75e10fc

Please sign in to comment.