diff options
author | Perry Mason <crazypark2@yahoo.dk> | 2010-12-16 00:36:09 +0100 |
---|---|---|
committer | Perry Mason <crazypark2@yahoo.dk> | 2010-12-16 00:36:09 +0100 |
commit | 41e6c7b8090bf5a117b349c8e815febf807e2c15 (patch) | |
tree | 5769015812db3e58b097a9d42dc5b2f6191d11a4 | |
parent | e1a43d989e093f4f8715aad7ad2dde1252fa122b (diff) | |
download | pfsense-packages-41e6c7b8090bf5a117b349c8e815febf807e2c15.tar.gz pfsense-packages-41e6c7b8090bf5a117b349c8e815febf807e2c15.tar.bz2 pfsense-packages-41e6c7b8090bf5a117b349c8e815febf807e2c15.zip |
[vnstat2] extra option added, going beta
-rw-r--r-- | config/vnstat2/vnstat2.inc | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | config/vnstat2/vnstat2.sh | 0 | ||||
-rw-r--r-- | config/vnstat2/vnstat2.xml | 33 | ||||
-rw-r--r-- | config/vnstat2/vnstati.xml | 8 | ||||
-rwxr-xr-x | pkg_config.8.xml | 4 |
5 files changed, 52 insertions, 7 deletions
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 index 05fb1136..05fb1136 100644..100755 --- a/config/vnstat2/vnstat2.sh +++ b/config/vnstat2/vnstat2.sh 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 @@ <text>Access vnstat php frontend</text> <url>/vnstat2</url> </tab> + <tab> + <text>vnstat info</text> + <url>/pkg_edit.php?xml=vnstatoutput.xml&id=0</url> + </tab> + <tab> + <text>vnstat summary</text> + <url>/diag_vnstat.php</url> + </tab> </tabs> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> <chmod>0644</chmod> - <item>http://www.pfsense.com/packages/config/vnstat2/vnstat2.inc</item> + <item>http://www,pfsense.com/packages/config/vnstat2/vnstat2.inc</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_php_frontend-1.4.1.tar.gz</item> + <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/vnstati.xml</item> + <item>http://www,pfsense.com/packages/config/vnstat2/vnstati.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> <chmod>0744</chmod> - <item>http://www.pfsense.com/packages/config/vnstat2/vnstat2.sh</item> + <item>http://www,pfsense.com/packages/config/vnstat2/vnstat2.sh</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/pkg/</prefix> + <chmod>0644</chmod> + <item>http://www,pfsense.com/packages/config/vnstat2/vnstatoutput.xml</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/pkg/</prefix> + <chmod>0644</chmod> + <item>http://www,pfsense.com/packages/config/vnstat2/bin/diag_vnstat.abc</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/pkg/</prefix> + <chmod>0644</chmod> + <item>http://www,pfsense.com/packages/config/vnstat2/bin/diag_vnstat2.abc</item> </additional_files_needed> <fields> <field> @@ -93,7 +116,7 @@ </field> </fields> <custom_add_php_command>change_vnstat_conf();</custom_add_php_command> - <custom_php_resync_config_command>vnstat_install_config();</custom_php_resync_config_command> + <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> </packagegui> 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 @@ <text>Access vnstat php frontend</text> <url>/vnstat2</url> </tab> + <tab> + <text>vnstat info</text> + <url>/pkg_edit.php?xml=vnstatoutput.xml&id=0</url> + </tab> + <tab> + <text>vnstat summary</text> + <url>/diag_vnstat.php</url> + </tab> </tabs> <fields> <field> 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 @@ <package> <name>vnstat2</name> <website>http://humdi.net/vnstat/</website> - <descr>A console-based network traffic monitor + vnstat PHP frontend</descr> + <descr>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.</descr> <pkginfolink>http://forum.pfsense.org/index.php/topic,14179.0.html</pkginfolink> <category>Network Management</category> <depends_on_package_base_url>http://files.pfsense.org/packages/8/All/</depends_on_package_base_url> <depends_on_package>vnstat-1.10_2.tbz</depends_on_package> <build_port_path>/usr/ports/net/vnstat</build_port_path> <version>1.10_2</version> - <status>test</status> + <status>Beta</status> <required_version>2.0</required_version> <maintainer>crazypark2@yahoo.dk</maintainer> <config_file>http://www.pfsense.com/packages/config/vnstat2/vnstat2.xml</config_file> |