[add] print flag

This commit is contained in:
Knah Tsaeb 2015-07-03 16:04:10 +02:00
parent 3f66739e44
commit 94f61fcdc6
258 changed files with 284 additions and 22 deletions

View File

@ -5,23 +5,28 @@ ip=$2
service=$3
curDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
echo $curDir
source $curDir/bancount.cfg
allInfoIp=`geoiplookup $ip`;
geoip () {
geoiplookup $ip | awk -F, '{print $2}' | sed s/\ //
echo $allInfoIp | awk -F, '{print $2}' | sed s/\ //
}
countryCode () {
echo $allInfoIp $ip | awk -F ": " '{ print $2 }' | awk -F "," '{ print $1 }' | head -n 1
}
case $action in
ban)
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`');"
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO bans (ip, service, ban_date, ban_time, country, countryCode) VALUES ( '$ip', '$service', '`date +%F`', '`date +%T`', '`geoip`', '`countryCode`');"
;;
unban)
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`');"
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "INSERT INTO unbans (ip, service, unban_date, unban_time, country, countryCode) VALUES ( '$ip', '$service', '`date +%F`', '`date +%T`', '`geoip`', '`countryCode`');"
;;
*)
@ -36,4 +41,4 @@ EOF
;;
esac
esac

View File

@ -29,6 +29,7 @@ CREATE TABLE `bans` (
`ban_date` varchar(10) DEFAULT NULL,
`ban_time` varchar(8) DEFAULT NULL,
`country` char(50) NOT NULL DEFAULT 'Martians!',
`countryCode` char(3) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
@ -47,6 +48,7 @@ CREATE TABLE `unbans` (
`unban_date` varchar(10) DEFAULT NULL,
`unban_time` varchar(8) DEFAULT NULL,
`country` char(50) DEFAULT NULL,
`countryCode` char(3) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

BIN
img/flag/16/ad.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

BIN
img/flag/16/ae.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

BIN
img/flag/16/af.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

BIN
img/flag/16/ag.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

BIN
img/flag/16/ai.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

BIN
img/flag/16/al.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

BIN
img/flag/16/am.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

BIN
img/flag/16/an.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

BIN
img/flag/16/ao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

BIN
img/flag/16/aq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

BIN
img/flag/16/ar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

BIN
img/flag/16/as.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

BIN
img/flag/16/at.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

BIN
img/flag/16/au.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

BIN
img/flag/16/aw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

BIN
img/flag/16/ax.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

BIN
img/flag/16/az.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

BIN
img/flag/16/ba.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

BIN
img/flag/16/bb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

BIN
img/flag/16/bd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

BIN
img/flag/16/be.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

BIN
img/flag/16/bf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

BIN
img/flag/16/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

BIN
img/flag/16/bh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

BIN
img/flag/16/bi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

BIN
img/flag/16/bj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

BIN
img/flag/16/bl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/bm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

BIN
img/flag/16/bn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

BIN
img/flag/16/bo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

BIN
img/flag/16/br.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

BIN
img/flag/16/bs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

BIN
img/flag/16/bt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

BIN
img/flag/16/bv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

BIN
img/flag/16/bw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

BIN
img/flag/16/by.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
img/flag/16/bz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

BIN
img/flag/16/ca.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

BIN
img/flag/16/cc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

BIN
img/flag/16/cd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

BIN
img/flag/16/cf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

BIN
img/flag/16/cg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

BIN
img/flag/16/ch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

BIN
img/flag/16/ci.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/ck.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

BIN
img/flag/16/cl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

BIN
img/flag/16/cm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

BIN
img/flag/16/cn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

BIN
img/flag/16/co.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

BIN
img/flag/16/cr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

BIN
img/flag/16/cu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

BIN
img/flag/16/cv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

BIN
img/flag/16/cx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

BIN
img/flag/16/cy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

BIN
img/flag/16/cz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

BIN
img/flag/16/de.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

BIN
img/flag/16/dj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

BIN
img/flag/16/dk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

BIN
img/flag/16/dm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

BIN
img/flag/16/do.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

BIN
img/flag/16/dz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

BIN
img/flag/16/ec.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

BIN
img/flag/16/ee.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

BIN
img/flag/16/eg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

BIN
img/flag/16/eh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

BIN
img/flag/16/er.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

BIN
img/flag/16/es.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

BIN
img/flag/16/et.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

BIN
img/flag/16/fi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

BIN
img/flag/16/fj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

BIN
img/flag/16/fk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

BIN
img/flag/16/fm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

BIN
img/flag/16/fo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

BIN
img/flag/16/fr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/ga.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

BIN
img/flag/16/gb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

BIN
img/flag/16/gd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

BIN
img/flag/16/ge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

BIN
img/flag/16/gf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/gg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

BIN
img/flag/16/gh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

BIN
img/flag/16/gi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

BIN
img/flag/16/gl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

BIN
img/flag/16/gm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

BIN
img/flag/16/gn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

BIN
img/flag/16/gp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

BIN
img/flag/16/gq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

BIN
img/flag/16/gr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

BIN
img/flag/16/gs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

BIN
img/flag/16/gt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

BIN
img/flag/16/gu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

BIN
img/flag/16/gw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

BIN
img/flag/16/gy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

BIN
img/flag/16/hk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

BIN
img/flag/16/hm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

BIN
img/flag/16/hn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

BIN
img/flag/16/hr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

BIN
img/flag/16/ht.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Some files were not shown because too many files have changed in this diff Show More