diff options
Diffstat (limited to 'config')
-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 |
4 files changed, 50 insertions, 5 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> |