From 939d922d762de9d4a31eab0b9530d3e766b3d7d7 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 8 Aug 2015 00:29:52 +0200 Subject: vnstat2 - code style cleanup round 2 - Add missing copyright header - Code style fixes --- config/vnstat2/vnstat2.inc | 100 ++++++++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 37 deletions(-) (limited to 'config') diff --git a/config/vnstat2/vnstat2.inc b/config/vnstat2/vnstat2.inc index ca8d869d..89a8b7c2 100644 --- a/config/vnstat2/vnstat2.inc +++ b/config/vnstat2/vnstat2.inc @@ -1,15 +1,42 @@ 0) { @@ -53,7 +80,7 @@ function vnstat2_install_cron($vnstat_cron_value) { } configure_cron(); } - break; + break; } } @@ -61,14 +88,14 @@ function change_vnstat_conf() { conf_mount_rw(); global $config; $config['installedpackages']['vnstat2']['config'][0]['monthrotate'] = $_POST['monthrotate']; - $config['installedpackages']['vnstat2']['config'][0]['vnstat_phpfrontend'] = $_POST['vnstat_phpfrontend']; + $config['installedpackages']['vnstat2']['config'][0]['vnstat_phpfrontend'] = $_POST['vnstat_phpfrontend']; write_conf_f(); write_config(); if ($config['installedpackages']['vnstat2']['config'][0]['vnstat_phpfrontend'] == "on") { vnstat_php_frontend(); } else { - exec("[ -d /usr/local/www/vnstat2 ] && rm -d -R /usr/local/www/vnstat2"); + exec("[ -d /usr/local/www/vnstat2 ] && /bin/rm -d -R /usr/local/www/vnstat2"); } conf_mount_ro(); } @@ -77,9 +104,9 @@ function write_conf_f() { global $config; $monthrotate = $config['installedpackages']['vnstat2']['config'][0]['monthrotate']; - // ************ Write new vnstat.conf ***************** + // Write new vnstat.conf $vnstat_conf_file = << EOF; - $hf = fopen("/usr/local/www/vnstat2/config.php","w"); + $hf = fopen("/usr/local/www/vnstat2/config.php", "w"); if (!$hf) { log_error("could not open /usr/local/www/vnstat2/config.php for writing"); exit; -- cgit v1.2.3