[add] common config file

This commit is contained in:
Knah Tsaeb 2015-05-29 15:21:27 +02:00
parent 37cb092a24
commit d59d4dae07
3 changed files with 13 additions and 6 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
bin/bancount.cfg

View File

@ -4,7 +4,10 @@ action=$1
ip=$2
service=$3
source bancount.cfg
curDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
echo $curDir
source $curDir/bancount.cfg
geoip () {
geoiplookup $ip | awk -F, '{print $2}' | sed s/\ //
@ -33,4 +36,4 @@ EOF
;;
esac
esac

View File

@ -12,6 +12,9 @@ echo "</head>\n";
echo "<body>\n";
echo "<div id='header'>\n";
$bddCfg = parse_ini_file('bin/bancount.cfg');
// Fail2BanCount - Displays information from the database
// I won't claim this is all my original code, as it has
// been borrowed from various places online. Use it as you
@ -19,10 +22,10 @@ echo "<div id='header'>\n";
// Database connection info
$db_host = 'localhost';
$db_user = 'fail2bancount';
$db_pwd = '';
$database = 'fail2bancount';
$db_host = '127.0.0.1';
$db_user = $bddCfg['mysqluser'];
$db_pwd = $bddCfg['mysqlpw'];
$database = $bddCfg['mysqldb'];
// Page variable