#!/bin/sh echo "Don't forget to update this script with the change-log! Press ENTER to start..." read NAME="fail2ban" VERSION="0.8.4" SOURCE="http://sourceforge.net/projects/fail2ban/files/fail2ban-stable/fail2ban-$VERSION/fail2ban-$VERSION.tar.bz2" DATE=`date '+%Y/%m/%d'` echo "Downloading essential packages..." tce-load -wi compiletc python squashfs-tools-4.x cd /tmp/ wget $SOURCE sudo rm -rf $NAME-$VERSION 2>/dev/null sudo rm /tmp/$NAME.tcz /tmp/$NAME.tcz.list /tmp/$NAME.tcz.md5.txt /tmp/$NAME.tcz.dep 2>/dev/null sudo rm -rf /tmp/$NAME 2>/dev/null tar xvf $NAME-$VERSION.tar.bz2 cd $NAME-$VERSION #sed -i.prev -e "s/#!\/usr\/bin\/python/#!\/usr\/local\/bin\/python/" setup.py sudo python setup.py build --verbose cd build sudo mv scripts-2.7 bin mkdir -p /tmp/$NAME/usr/local/etc/fail2ban mkdir -p /tmp/$NAME/usr/share/fail2ban sudo mv bin /tmp/$NAME/usr/local/ sudo mv lib/* /tmp/$NAME/usr/share/fail2ban cd ../config sudo cp -r * /tmp/$NAME/usr/local/etc/fail2ban/ echo "Creating package..." cd /tmp/ sudo mksquashfs $NAME $NAME.tcz sudo md5sum $NAME.tcz > $NAME.tcz.md5.txt cd $NAME sudo find usr -not -type d > ../$NAME.tcz.list cd /tmp/ SIZE="`du -k $NAME.tcz|cut -f1`k" sudo echo "Title: $NAME.tcz Description: Fail2Ban Version: $VERSION Author: Cyril Jaquier Original-site: http://www.fail2ban.org/ Copying-policy: GPLv2 Size: $SIZE Extension_by: andriscom Comments: Fail2Ban scans log files like /var/log/pwdfail and bans IP that makes too many password failures. It updates firewall rules to reject the IP address. These rules can be defined by the user. Fail2Ban can read multiple log files. You can configure Fail2ban using the files in /usr/local/etc/fail2ban. It is possible to configure the server using commands sent to it by fail2ban-client. The available commands are described in the man page of fail2ban-client. Please refer to it or to the website: http://www.fail2ban.org Built with the following command: python setup.py build --verbose Fail2Ban is Python script so no compiling needed. You should edit the configuration files: /usr/local/etc/fail2ban/ Use the: 'fail2ban-client -d -c /usr/share/fail2ban' command to debug! Source: $SOURCE Change-log: 2010/10/16 Version: 0.8.4 $DATE Version: $VERSION - Rebuilt with Python 2.7, dependency changed to python.tcz Current: $DATE Version: $VERSION - Rebuilt with Python 2.7, dependency changed to python.tcz " > $NAME.tcz.info sudo echo "python.tcz iptables.tcz " > $NAME.tcz.dep cd /tmp/ mkdir packages 2>/dev/null sudo rm packages/$NAME.tar.gz 2>/dev/null tar zcf packages/$NAME.tar.gz $NAME.tcz* echo " Run bcrypt on /tmp/packages/*.tar.gz... give password: tinycore" echo "Run the extension_audit.sh and reboot a clean system to try the packages!" echo "Send it to: tcesubmit@gmail.com"