some fixes and new README.md
This commit is contained in:
parent
3ba8181493
commit
87bf7ee5ed
3 changed files with 8 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -19,7 +19,6 @@
|
||||||
!bin/stats.sh
|
!bin/stats.sh
|
||||||
|
|
||||||
!.config
|
!.config
|
||||||
|
|
||||||
!.config/awesome
|
!.config/awesome
|
||||||
!.config/awesome/**
|
!.config/awesome/**
|
||||||
.config/awesome/private.lua
|
.config/awesome/private.lua
|
||||||
|
|
|
||||||
4
bin/README.md
Normal file
4
bin/README.md
Normal 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.
|
||||||
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
output="/var/www/localhost/htdocs/stats/"
|
output="/var/www/localhost/htdocs/stats/"
|
||||||
nic="eth0"
|
nic="eth0"
|
||||||
|
name=$(hostname)
|
||||||
|
|
||||||
generate_index() {
|
generate_index() {
|
||||||
cat <<-EOF
|
cat <<-EOF
|
||||||
|
|
@ -12,7 +13,7 @@ generate_index() {
|
||||||
<meta http-equiv="cache-control" content=no-cache">
|
<meta http-equiv="cache-control" content=no-cache">
|
||||||
<meta http-equiv="refresh" content="3000">
|
<meta http-equiv="refresh" content="3000">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>e: eth0 network statistics</title>
|
<title>$name: $nic network statistics</title>
|
||||||
</head>
|
</head>
|
||||||
<body style="background-color:#444">
|
<body style="background-color:#444">
|
||||||
<div style="text-align:center">
|
<div style="text-align:center">
|
||||||
|
|
@ -27,10 +28,10 @@ generate_index() {
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ ! -f "$output"/index.html ]; then
|
#if [ ! -f "$output"/index.html ]; then
|
||||||
mkdir -p $output
|
mkdir -p $output
|
||||||
generate_index > "$output"/index.html
|
generate_index > "$output"/index.html
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
for type in hours days months top10 summary hsummary vsummary; do
|
for type in hours days months top10 summary hsummary vsummary; do
|
||||||
vnstati --${type} -i $nic -o $output/${type}.png
|
vnstati --${type} -i $nic -o $output/${type}.png
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue