-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcron.sh
executable file
·25 lines (24 loc) · 1.39 KB
/
cron.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#########################################################
#cron.sh #
#This file is what should be added to the cron job. #
#Date: 1/3/2015 (added in config file directives #
#Version: 0.1 #
#Author: Zachary Wikholm #
#Email: [email protected] #
#########################################################
source blacklist.config
DATE=`date "+%b_%d_%Y"`
YEST=`perl -w -e '@yest=localtime(time-86400);printf "%d%.2d%.2d",$yest[5]+1900,$yest[4]+1,$yest[3];'`
curl -s http://www.spamhaus.org/drop/drop.txt > $install_dir/static_lists/drop.txt
curl -s http://www.spamhaus.org/drop/edrop.txt > $install_dir/static_lists/edrop.txt
mkdiri -p $install_dir/ssh_bruteforce/archive/$YEST/
mv $install_dir/ssh_bruteforce/final_list.txt $install_dir/ssh_bruteforce/archive/$YEST/final_list-$YEST.txt
FILES=`cd $install_dir/ssh_bruteforce && ls | grep -v $DATE`
cd $install_dir/ssh_bruteforce
mv $install_dir/ssh_bruteforce/$FILES $install_dir/ssh_bruteforce/archive/$YEST/
$install_dir/rsync_cron.sh
/usr/bin/perl $install_dir/auto6.pl 2> /dev/null | perl -e '($_ = join "",<>) =~ s/(\t)/ /g; print;' | sendEmail -f "$from_email" -u "$subject" -t "$to_email"
/usr/bin/perl $install_dir/blacklist.pl
/usr/bin/perl $install_dir/dbmaint.pl 2> /dev/null | perl -e '($_ = join "",<>) =~ s/(\t)/ /g; print;' | sendEmail -f "$from_email" -u "$subject" -t "$to_email"
/usr/bin/perl $install_dir/asn_update.pl