Skip to content

Commit

Permalink
Add checks before cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
verovaleros committed Jul 25, 2024
1 parent c982094 commit 3e95829
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cleaning/zeek_purge_ip_from_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ log() {

# Function to clean up temporary files
cleanup() {
rm -f "$temp_file"
log "Cleaned up temporary files"
if [ -n "$temp_file" ] && [ -f "$temp_file" ]; then
rm -f "$temp_file"
log "Cleaned up temporary files"
fi
}

# Trap signals for cleanup
Expand Down

0 comments on commit 3e95829

Please sign in to comment.