From 41e6c7b8090bf5a117b349c8e815febf807e2c15 Mon Sep 17 00:00:00 2001 From: Perry Mason Date: Thu, 16 Dec 2010 00:36:09 +0100 Subject: [vnstat2] extra option added, going beta --- config/vnstat2/vnstat2.inc | 14 ++++++++++++++ config/vnstat2/vnstat2.sh | 0 config/vnstat2/vnstat2.xml | 33 ++++++++++++++++++++++++++++----- config/vnstat2/vnstati.xml | 8 ++++++++ pkg_config.8.xml | 4 ++-- 5 files changed, 52 insertions(+), 7 deletions(-) mode change 100644 => 100755 config/vnstat2/vnstat2.sh diff --git a/config/vnstat2/vnstat2.inc b/config/vnstat2/vnstat2.inc index 4b78cde2..a8ebe5d5 100644 --- a/config/vnstat2/vnstat2.inc +++ b/config/vnstat2/vnstat2.inc @@ -9,6 +9,8 @@ function vnstat_install_deinstall() { exec("rm /usr/local/pkg/vnstat_php_frontend.xml"); exec("rm /usr/local/pkg/vnstat2.sh"); exec("rm /usr/local/etc/vnstat2.conf"); + exec("rm /usr/local/www/diag_vnstat.php"); + exec("rm /usr/local/www/diag_vnstat2.php"); // Remove vnstat cron entry from config.xml vnstat2_install_cron(false); conf_mount_ro(); @@ -119,6 +121,16 @@ function create_vnstati_image() { conf_mount_ro(); } +function create_vnstat_output() { + conf_mount_rw(); + global $config; + $iface2 = $_POST['vnstat_interface2']; + $ifaces_final2 = convert_friendly_interface_to_real_interface_name($iface2); + $config['installedpackages']['vnstat2']['config'][0]['vnstat_output_nic'] = $ifaces_final2; + write_config(); + conf_mount_ro(); +} + function vnstat_install_config() { global $config; conf_mount_rw(); @@ -126,6 +138,8 @@ function vnstat_install_config() { exec("[ -d /var/db/vnstat ] && mv /var/db/pkg/vnstat /conf/vnstat"); exec("[ -d /usr/local/pkg/vnstat ] && mv /usr/local/pkg/vnstat /conf/vnstat"); exec("[ ! -d /conf/vnstat ] && mkdir /conf/vnstat"); + exec("[ ! -f /usr/local/www/diag_vnstat2.php ] && cp /usr/local/pkg/diag_vnstat2.abc /usr/local/www/diag_vnstat2.php"); + exec("[ ! -f /usr/local/www/diag_vnstat.php ] && cp /usr/local/pkg/diag_vnstat.abc /usr/local/www/diag_vnstat.php"); // Unpack and move Vnstat frontend exec("cd .."); exec("tar -zxovf /usr/local/pkg/vnstat_php_frontend-1.4.1.tar.gz"); diff --git a/config/vnstat2/vnstat2.sh b/config/vnstat2/vnstat2.sh old mode 100644 new mode 100755 diff --git a/config/vnstat2/vnstat2.xml b/config/vnstat2/vnstat2.xml index eb077918..e53f8eb4 100644 --- a/config/vnstat2/vnstat2.xml +++ b/config/vnstat2/vnstat2.xml @@ -31,26 +31,49 @@ Access vnstat php frontend /vnstat2 + + vnstat info + /pkg_edit.php?xml=vnstatoutput.xml&id=0 + + + vnstat summary + /diag_vnstat.php + /usr/local/pkg/ 0644 - http://www.pfsense.com/packages/config/vnstat2/vnstat2.inc + http://www,pfsense.com/packages/config/vnstat2/vnstat2.inc /usr/local/pkg/ 0644 - http://www.pfsense.com/packages/config/vnstat2/bin/vnstat_php_frontend-1.4.1.tar.gz + http://www,pfsense.com/packages/config/vnstat2/bin/vnstat_php_frontend-1.4.1.tar.gz /usr/local/pkg/ 0644 - http://www.pfsense.com/packages/config/vnstat2/vnstati.xml + http://www,pfsense.com/packages/config/vnstat2/vnstati.xml /usr/local/pkg/ 0744 - http://www.pfsense.com/packages/config/vnstat2/vnstat2.sh + http://www,pfsense.com/packages/config/vnstat2/vnstat2.sh + + + /usr/local/pkg/ + 0644 + http://www,pfsense.com/packages/config/vnstat2/vnstatoutput.xml + + + /usr/local/pkg/ + 0644 + http://www,pfsense.com/packages/config/vnstat2/bin/diag_vnstat.abc + + + /usr/local/pkg/ + 0644 + http://www,pfsense.com/packages/config/vnstat2/bin/diag_vnstat2.abc @@ -93,7 +116,7 @@ change_vnstat_conf(); - vnstat_install_config(); + vnstat_install_config(); vnstat_install_deinstall(); diff --git a/config/vnstat2/vnstati.xml b/config/vnstat2/vnstati.xml index 6e779fe6..8c616cc2 100644 --- a/config/vnstat2/vnstati.xml +++ b/config/vnstat2/vnstati.xml @@ -31,6 +31,14 @@ Access vnstat php frontend /vnstat2 + + vnstat info + /pkg_edit.php?xml=vnstatoutput.xml&id=0 + + + vnstat summary + /diag_vnstat.php + diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 6648418a..1d8fe604 100755 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -406,14 +406,14 @@ vnstat2 http://humdi.net/vnstat/ - A console-based network traffic monitor + vnstat PHP frontend + Vnstat is a console-based network traffic monitor<br />The vnstat PHP frontend and vnstati adds a more user friendly way of displaying traffic usage. http://forum.pfsense.org/index.php/topic,14179.0.html Network Management http://files.pfsense.org/packages/8/All/ vnstat-1.10_2.tbz /usr/ports/net/vnstat 1.10_2 - test + Beta 2.0 crazypark2@yahoo.dk http://www.pfsense.com/packages/config/vnstat2/vnstat2.xml -- cgit v1.2.3