diff options
author | Renato Botelho <renato@netgate.com> | 2015-09-08 08:25:22 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-09-08 08:25:22 -0300 |
commit | 46556938dc1664a6a9dd75ff99e78e192088c769 (patch) | |
tree | 7645aa2a21d34fecba26a07cf647357d4a88b9d3 | |
parent | 1e83c36e70c185e197143f323ec5bff91ce03ec5 (diff) | |
parent | 61cda8960b9cca712bfb6b84fa280f9eaee1c418 (diff) | |
download | pfsense-packages-46556938dc1664a6a9dd75ff99e78e192088c769.tar.gz pfsense-packages-46556938dc1664a6a9dd75ff99e78e192088c769.tar.bz2 pfsense-packages-46556938dc1664a6a9dd75ff99e78e192088c769.zip |
Merge pull request #1037 from doktornotor/patch-10
-rw-r--r-- | config/vnstat2/vnstat2.inc | 47 | ||||
-rw-r--r-- | pkg_config.10.xml | 2 |
2 files changed, 3 insertions, 46 deletions
diff --git a/config/vnstat2/vnstat2.inc b/config/vnstat2/vnstat2.inc index 86a95346..b42bc0a9 100644 --- a/config/vnstat2/vnstat2.inc +++ b/config/vnstat2/vnstat2.inc @@ -30,56 +30,13 @@ require_once("util.inc"); function vnstat_install_deinstall() { - global $config; // Remove Vnstat package and files exec("/bin/rm -d -R /usr/local/www/vnstat2"); exec("/bin/rm -d -R /usr/local/www/vnstati"); exec("/bin/rm -d -R /usr/local/pkg/vnstat2"); exec("/bin/rm /usr/local/etc/vnstat.conf"); // Remove vnstat cron entry from config.xml - vnstat2_install_cron(false); -} - -function vnstat2_install_cron($vnstat_cron_value) { - global $config; - $is_installed = false; - if (!$config['cron']['item']) { - return; - } - $x=0; - foreach ($config['cron']['item'] as $item) { - if (strstr($item['command'], "/usr/local/pkg/vnstat2/vnstat2.sh")) { - $is_installed = true; - break; - } - $x++; - } - switch ($vnstat_cron_value) { - case true: - if (!$is_installed) { - $cron_item = array(); - $cron_item['minute'] = "*/1"; - $cron_item['hour'] = "*"; - $cron_item['mday'] = "*"; - $cron_item['month'] = "*"; - $cron_item['wday'] = "*"; - $cron_item['who'] = "root"; - $cron_item['command'] = "/usr/local/pkg/vnstat2/vnstat2.sh"; - $config['cron']['item'][] = $cron_item; - write_config(); - configure_cron(); - } - break; - case false: - if ($is_installed == true) { - if ($x > 0) { - unset($config['cron']['item'][$x]); - write_config(); - } - configure_cron(); - } - break; - } + install_cron_job("/usr/local/pkg/vnstat2/vnstat2.sh", false); } function change_vnstat_conf() { @@ -226,7 +183,7 @@ function vnstat_install_config() { } write_conf_f(); // Add cron job to config.xml - vnstat2_install_cron(true); + install_cron_job("/usr/local/pkg/vnstat2/vnstat2.sh", true, "*/1"); vnstat_create_nic_dbs(); write_config(); conf_mount_ro(); diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 56ff8523..5c3d51b1 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -688,7 +688,7 @@ <build_pbi> <port>net/vnstat</port> </build_pbi> - <version>1.12.6</version> + <version>1.12.7</version> <status>Stable</status> <required_version>2.2</required_version> <maintainer>crazypark2@yahoo.dk</maintainer> |