# First, we'll define a few functions so we don't have to
# do the same thing over and over again.
#####
ipfind (){
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "SELECT ip,COUNT(*) count,country FROM bans GROUP BY ip HAVING count > 1 ORDER BY count DESC;"| sed '/ip/d'
}
recent (){
# mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "SELECT ip,ban_date,ban_time,country FROM bans WHERE id > ((SELECT MAX(id) FROM bans) - $total)" | sed '/ip/d'
mysql $mysqldb -u $mysqluser --password=$mysqlpw -e "SELECT ip,ban_date,ban_time,country FROM bans WHERE bans.id NOT IN ( SELECT unbans.id FROM unbans WHERE bans.id=unbans.id)"| sed '/ip/d'
}
#####
# Now we'll define some global variables
#####
# Find the number of IPs banned
# Added sanity check for systems with no IPs banned