diff --git a/config.php b/config.php index e9d4718..4d1e6cd 100644 --- a/config.php +++ b/config.php @@ -23,6 +23,9 @@ // Path of vnstat $vnstat_bin_dir = '/usr/bin/vnstat'; +// Uncomment to override default config file +//$vnstat_config = '/etc/vnstat.conf'; + // Set to true to set your own interfaces $use_predefined_interfaces = false; diff --git a/index.php b/index.php index 0eca23b..dd50adc 100644 --- a/index.php +++ b/index.php @@ -77,6 +77,13 @@ function printTableStats($path, $type, $interface, $label) // Assume they mean the first interface $thisInterface = reset($interface_list); } + +if (isset($vnstat_config)) { + $vnstat_cmd = $vnstat_bin_dir.' --config '.$vnstat_config; +} else { + $vnstat_cmd = $vnstat_bin_dir; +} + ?> @@ -86,39 +93,161 @@ function printTableStats($path, $type, $interface, $label) - + - - + +
+ +