initial commit of file from CVS for smeserver-bandwidthd on Sat Sep 7 20:10:36 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:10:36 +10:00
parent 39d69687d3
commit bd26bff825
36 changed files with 707 additions and 2 deletions

View File

@@ -0,0 +1,45 @@
{
my $width = $bandwidthd{'width'} || "900";
my $height = $bandwidthd{'height'} || "256";
my $interval = $bandwidthd{'interval'} || "INT_DAILY";
$OUT .= "define('DFLT_WIDTH', $width);\n";
$OUT .= "define('DFLT_HEIGHT', $height);\n";
$OUT .= "define('DFLT_INTERVAL', $interval);\n";
}
// Select type of database you are using
// Possible values are DB_PGSQL and DB_MYSQL
{
my $dbtype = $bandwidthd{'DbType'} || "mysql";
if ( $dbtype eq "mysql")
{$dbtype = "DB_MYSQL";}
else
{$dbtype = "DB_PGSQL";}
$OUT .= "\$dbtype = $dbtype;\n";
}
// Configuration for PostgreSQL
{
$OUT .= "\n";
my $dbtype = $bandwidthd{'DbType'} || "mysql";
my $dbhost = $bandwidthd{'Dbhost'} || "localhost";
$OUT .= "\$pgsql_connect_string = \"user = ".$bandwidthd{'DbUser'}." password = ". $bandwidthd{'DbPassword'} ." dbname = ".$bandwidthd{'DbName'}." host = $dbhost\";\n"
unless $dbtype eq "mysql";
}
// Configuration for MySQL
// You can specify port after semicolon, for example "localhost:4067"
{
my $dbhost = $bandwidthd{'Dbhost'} || "localhost";
$OUT .= "\$mysql_host = \"$dbhost\";\n";
$OUT .= "\$mysql_user = \"".$bandwidthd{'DbUser'}."\";\n";
$OUT .= "\$mysql_pass = \"". $bandwidthd{'DbPassword'} ."\";\n";
$OUT .= "\$mysql_dbname = \"".$bandwidthd{'DbName'}."\";\n";
}