some fixes and new README.md

This commit is contained in:
Johannes Findeisen 2019-01-18 21:50:34 +01:00
commit e3a3bec768
3 changed files with 8 additions and 4 deletions

1
.gitignore vendored
View file

@ -19,7 +19,6 @@
!bin/stats.sh
!.config
!.config/awesome
!.config/awesome/**
.config/awesome/private.lua

4
bin/README.md Normal file
View file

@ -0,0 +1,4 @@
Some of my Shell scripts I share with other systems.
Some of them need a ~/.config.sh file for working properly.

View file

@ -2,6 +2,7 @@
output="/var/www/localhost/htdocs/stats/"
nic="eth0"
name=$(hostname)
generate_index() {
cat <<-EOF
@ -12,7 +13,7 @@ generate_index() {
<meta http-equiv="cache-control" content=no-cache">
<meta http-equiv="refresh" content="3000">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>e: eth0 network statistics</title>
<title>$name: $nic network statistics</title>
</head>
<body style="background-color:#444">
<div style="text-align:center">
@ -27,10 +28,10 @@ generate_index() {
EOF
}
if [ ! -f "$output"/index.html ]; then
#if [ ! -f "$output"/index.html ]; then
mkdir -p $output
generate_index > "$output"/index.html
fi
#fi
for type in hours days months top10 summary hsummary vsummary; do
vnstati --${type} -i $nic -o $output/${type}.png