diff --git a/includes/vnstat.php b/includes/vnstat.php new file mode 100644 index 00000000..d9735f25 --- /dev/null +++ b/includes/vnstat.php @@ -0,0 +1,120 @@ +addMessage(sprinf(_('Getting vnstat %s information failed.'), _('daily')), 'error'); + } + + exec('vnstat -w ', $stdoutvnstatweekly, $exitcodeweekly); + if ($exitcodeweekly !== 0) { + $status->addMessage(sprinf(_('Getting vnstat %s information failed.'), _('weekly')), 'error'); + } + + exec('vnstat -d ', $stdoutvnstatdaily, $exitcodedaily); + if ($exitcodedaily !== 0) { + $status->addMessage(sprinf(_('Getting vnstat %s information failed.'), _('monthly')), + 'error'); + } +?> +
+
+
+
+
+ +
+
+
+
+

showMessages(); ?>

+ + + +
+
+
+
+

Daily traffic amount

+' , str_replace(' ', ' ', htmlentities($linedaily, ENT_QUOTES)) , + '
'; +} + +?> +
+
+
+
+ +
+
+
+

+' , str_replace(' ', ' ', htmlentities($lineweekly, ENT_QUOTES)) , + '
', PHP_EOL; +} + +?> + +
+
+
+ +
+
+
+

+' , str_replace(' ', ' ', htmlentities($linemonthly, ENT_QUOTES)) , + '
' , PHP_EOL; +} + +?> +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ + +
  • + +
  • +
  • @@ -207,6 +215,9 @@ $theme_url = 'dist/css/'.htmlspecialchars($theme, ENT_QUOTES); case "theme_conf": DisplayThemeConfig(); break; + case "vnstat": + DisplayVnstat(); + break; case "system_info": DisplaySystem(); break; diff --git a/installers/raspbian.sh b/installers/raspbian.sh index ecf395c7..01de6c1a 100755 --- a/installers/raspbian.sh +++ b/installers/raspbian.sh @@ -9,7 +9,7 @@ function update_system_packages() { function install_dependencies() { install_log "Installing required packages" - sudo apt-get install lighttpd $php_package git hostapd dnsmasq || install_error "Unable to install dependencies" + sudo apt-get install lighttpd $php_package git hostapd dnsmasq vnstat || install_error "Unable to install dependencies" } install_raspap