test 13

t

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don’t look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn’t anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don’t look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn’t anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.

#!/bin/bash
 
# not very clean script but it works & i can't be arsed this time :)
 
#set -x  # debug, can be commented out
 
date=$(date '+%Y-%m-%d')
workdir=$(dirname "$0")
maildir="$workdir/mailout"
f2b_log="/var/log/fail2ban.log"
log="$maildir/scan_$date.txt"
sleep="3"
days="30"
 
mailto=(
        "xxx.xx@xxxx.com"
)
 
ips=(
        $( cat "$f2b_log" | grep "Restore Ban" | cut -d " " -f17 | uniq )
)
 
if [[ ! -d $maildir ]]
then
        mkdir -p "$maildir"
fi
 
echo -e "################# $date #################\\n" > "$log"
 
for IP in "${ips[@]}"; do
        echo -e "\\n=================[ start scan for $IP ]=================" >> "$log"
        nmap -A -T4 "$IP" --host-timeout 1m >> "$log"
        echo -e "==================[ end scan for $IP ]==================\\n" >> "$log"
 
sleep "$sleep"
done
 
echo -e "\\n################# end file #################" >> "$log"
 
for M in "${mailto[@]}"; do
        mail -s "nmap scan results on $date" "$M" < "$log"
done
 
find "$maildir" -mtime +"$days" -exec rm -rf {} \;

Recent Posts

Pages

Archives

About

middle aged linux nerd. likes coding and pizza. owner of this particular site.