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 /config/vnstat2/vnstat2.inc | |
parent | e1a43d989e093f4f8715aad7ad2dde1252fa122b (diff) | |
download | pfsense-packages-41e6c7b8090bf5a117b349c8e815febf807e2c15.tar.gz pfsense-packages-41e6c7b8090bf5a117b349c8e815febf807e2c15.tar.bz2 pfsense-packages-41e6c7b8090bf5a117b349c8e815febf807e2c15.zip |
[vnstat2] extra option added, going beta
Diffstat (limited to 'config/vnstat2/vnstat2.inc')
-rw-r--r-- | config/vnstat2/vnstat2.inc | 14 |
1 files changed, 14 insertions, 0 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"); |