[chg] reorganize file

This commit is contained in:
Knah Tsaeb 2015-05-27 12:25:08 +02:00
parent 7143ef3654
commit 63197e78d5
7 changed files with 12 additions and 6 deletions

0
INSTALL Normal file
View File

1
bin/.htaccess Normal file
View File

@ -0,0 +1 @@
Deny from all

5
bin/bancount.cfg.sample Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
mysqldb="fail2bancount"
mysqlpw=""
mysqluser="fail2bancount"

View File

@ -2,11 +2,9 @@
action=$1
ip=$2
port=$3
service=$3
mysqldb="fail2bancount"
mysqlpw=""
mysqluser="fail2bancount"
source bancount.cfg
geoip () {
geoiplookup $ip | awk -F, '{print $2}' | sed s/\ //
@ -15,12 +13,12 @@ geoip () {
case $action in
ban)
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO bans (ip, ban_date, ban_time, country) VALUES ( '$ip', '`date +%F`', '`date +%T`', '`geoip $ip`');"
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO bans (ip, service, ban_date, ban_time, country) VALUES ( '$ip', '$service', '`date +%F`', '`date +%T`', '`geoip $ip`');"
;;
unban)
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO unbans (ip, unban_date, unban_time, country) VALUES ( '$ip', '`date +%F`', '`date +%T`', '`geoip $ip`');"
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO unbans (ip, service, unban_date, unban_time, country) VALUES ( '$ip', '$service', '`date +%F`', '`date +%T`', '`geoip $ip`');"
;;
*)

View File

@ -25,6 +25,7 @@ DROP TABLE IF EXISTS `bans`;
CREATE TABLE `bans` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(15) DEFAULT NULL,
`service` TEXT NOT NULL,
`ban_date` varchar(10) DEFAULT NULL,
`ban_time` varchar(8) DEFAULT NULL,
`country` char(50) NOT NULL DEFAULT 'Martians!',
@ -42,6 +43,7 @@ DROP TABLE IF EXISTS `unbans`;
CREATE TABLE `unbans` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(15) DEFAULT NULL,
`service` TEXT NOT NULL,
`unban_date` varchar(10) DEFAULT NULL,
`unban_time` varchar(8) DEFAULT NULL,
`country` char(50) DEFAULT NULL,