diff options
-rw-r--r-- | config/vnstat2/bin/vnstat.conf | 25 | ||||
-rw-r--r-- | config/vnstat2/vnstat2.inc | 9 | ||||
-rw-r--r-- | config/vnstat2/vnstat2.xml | 5 |
3 files changed, 36 insertions, 3 deletions
diff --git a/config/vnstat2/bin/vnstat.conf b/config/vnstat2/bin/vnstat.conf new file mode 100644 index 00000000..00ca2840 --- /dev/null +++ b/config/vnstat2/bin/vnstat.conf @@ -0,0 +1,25 @@ +# vnStat 1.10 config file +## + +# location of the database directory +# DatabaseDir "/usr/local/pkg/vnstat" + +# on which day should months change +MonthRotate 1 + +# vnstati +## + +# image colors +CBackground "F0F0F0" +CEdge "AEAEAE" +CHeader "990000" +CHeaderTitle "F0F0F0" +CHeaderDate "FFFFFF" +CText "000000" +CLine "B0B0B0" +CLineL "-" +CRx "666666" +CTx "990000" +CRxD "-" +CTxD "-" diff --git a/config/vnstat2/vnstat2.inc b/config/vnstat2/vnstat2.inc index 2ce25c9e..75c4f9db 100644 --- a/config/vnstat2/vnstat2.inc +++ b/config/vnstat2/vnstat2.inc @@ -28,11 +28,14 @@ function vnstat_install_deinstall() { function vnstat_install_config() { global $config; conf_mount_rw(); - exec("[ ! -d dir ] && mkdir /var/db/vnstat"); +// Create vnstat database dir where it also will work for nanobsd + exec("[ ! -d dir ] && mkdir /usr/local/pkg/vnstat"); // Unpack and move Vnstat frontend exec("cd .."); exec("tar -zxovf /usr/local/pkg/vnstat_php_frontend-1.4.1.tar.gz"); exec("mv vnstat_php_frontend-1.4.1 /usr/local/www/vnstat2"); +// Move Vnstat config + exec("mv /usr/local/pkg/vnstat.conf /usr/local/etc/vnstat.conf"); // Add cron job to config.xml $cron_item = array(); $cron_item['minute'] = "*/1"; @@ -55,7 +58,7 @@ function vnstat_install_config() { array_push($array_of_real_nic_names, $real_nic_names); endforeach; // Get already nic's assigned to vnstat - exec("ls /var/db/vnstat/ | grep -v '\.'", $vnstat_nic); + exec("ls /usr/local/pkg/vnstat/ | grep -v '\.'", $vnstat_nic); // Compare real nic's with nic's assigned to vnstat $result = array_diff($array_of_real_nic_names, $vnstat_nic); // Create database for each nic @@ -65,7 +68,7 @@ function vnstat_install_config() { } // Find information to be writing in config.php // $iface_list_array_items - exec("ls /var/db/vnstat/ | grep -v '\.'", $vnstat_nic_in); + exec("ls /usr/local/pkg/vnstat/ | grep -v '\.'", $vnstat_nic_in); $iface_list_array_items = implode("', '", $vnstat_nic_in); $iface_list_array = "\$iface_list = array('$iface_list_array_items');"; // $iface_title_array_items diff --git a/config/vnstat2/vnstat2.xml b/config/vnstat2/vnstat2.xml index 074ef86d..2e86c989 100644 --- a/config/vnstat2/vnstat2.xml +++ b/config/vnstat2/vnstat2.xml @@ -27,6 +27,11 @@ <chmod>0644</chmod> <item>http://www.pfsense.com/packages/config/vnstat2/bin/vnstat_php_frontend-1.4.1.tar.gz</item> </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/pkg/</prefix> + <chmod>0644</chmod> + <item>http://www.pfsense.com/packages/config/vnstat2/bin/vnstat.conf</item> + </additional_files_needed> <custom_php_resync_config_command></custom_php_resync_config_command> <custom_php_install_command>vnstat_install_config();</custom_php_install_command> <custom_php_deinstall_command>vnstat_install_deinstall();</custom_php_deinstall_command> |