[add] common config file
This commit is contained in:
parent
37cb092a24
commit
d59d4dae07
|
@ -0,0 +1 @@
|
||||||
|
bin/bancount.cfg
|
|
@ -4,7 +4,10 @@ action=$1
|
||||||
ip=$2
|
ip=$2
|
||||||
service=$3
|
service=$3
|
||||||
|
|
||||||
source bancount.cfg
|
curDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
|
||||||
|
echo $curDir
|
||||||
|
|
||||||
|
source $curDir/bancount.cfg
|
||||||
|
|
||||||
geoip () {
|
geoip () {
|
||||||
geoiplookup $ip | awk -F, '{print $2}' | sed s/\ //
|
geoiplookup $ip | awk -F, '{print $2}' | sed s/\ //
|
||||||
|
@ -33,4 +36,4 @@ EOF
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
11
index.php
11
index.php
|
@ -12,6 +12,9 @@ echo "</head>\n";
|
||||||
echo "<body>\n";
|
echo "<body>\n";
|
||||||
echo "<div id='header'>\n";
|
echo "<div id='header'>\n";
|
||||||
|
|
||||||
|
$bddCfg = parse_ini_file('bin/bancount.cfg');
|
||||||
|
|
||||||
|
|
||||||
// Fail2BanCount - Displays information from the database
|
// Fail2BanCount - Displays information from the database
|
||||||
// I won't claim this is all my original code, as it has
|
// I won't claim this is all my original code, as it has
|
||||||
// been borrowed from various places online. Use it as you
|
// been borrowed from various places online. Use it as you
|
||||||
|
@ -19,10 +22,10 @@ echo "<div id='header'>\n";
|
||||||
|
|
||||||
// Database connection info
|
// Database connection info
|
||||||
|
|
||||||
$db_host = 'localhost';
|
$db_host = '127.0.0.1';
|
||||||
$db_user = 'fail2bancount';
|
$db_user = $bddCfg['mysqluser'];
|
||||||
$db_pwd = '';
|
$db_pwd = $bddCfg['mysqlpw'];
|
||||||
$database = 'fail2bancount';
|
$database = $bddCfg['mysqldb'];
|
||||||
|
|
||||||
// Page variable
|
// Page variable
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue