Actualizar 'vnstati.sh'
This commit is contained in:
parent
ad6509694b
commit
1d7673d803
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if ! command -v vnstati >/dev/null; then echo "I require vnstati but it's not installed."; sudo apt install vnstati; else echo "vnstati OK"; fi;
|
if ! command -v vnstati >/dev/null; then echo "I require vnstati but it's not installed."; sudo apt install vnstati; else echo "vnstati OK"; fi;
|
||||||
if ! command -v sendmail >/dev/null; then echo "I require sendmail but it's not installed."; sudo apt install sendmail; else echo "sendmail OK"; fi;
|
if ! command -v sendmail >/dev/null; then echo "I require sendmail but it's not installed."; sudo apt install sendmail; else echo "sendmail OK"; fi;
|
||||||
if id -nG "$USER" | grep -qw "mail"; then echo ""; else sudo usermod -aG mail $USER; fi
|
if id -nG "$USER" | grep -qw "mail"; then echo "User in mail group"; else sudo usermod -aG mail $USER; fi
|
||||||
IFACE=$(ip -br l | awk '$1 !~ "lo|vir|vet|br|docker" { print $1}')
|
IFACE=$(ip -br l | awk '$1 !~ "lo|vir|vet|br|docker" { print $1}')
|
||||||
for i in $IFACE;do
|
for i in $IFACE;do
|
||||||
vnstati -d 7 -i $i -o $i.png
|
vnstati -d 7 -i $i -o $i.png
|
||||||
|
@ -27,7 +27,7 @@ done
|
||||||
|
|
||||||
/usr/sbin/sendmail -t <<EOT
|
/usr/sbin/sendmail -t <<EOT
|
||||||
TO: alfonso@vivancos.eu
|
TO: alfonso@vivancos.eu
|
||||||
FROM: alfonso@cayuela.eu
|
FROM: $USER@$(hostname -A)
|
||||||
SUBJECT: $HOSTNAME traffic summary $(date +%c)
|
SUBJECT: $HOSTNAME traffic summary $(date +%c)
|
||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
Content-Type: multipart/related;boundary="XYZ"
|
Content-Type: multipart/related;boundary="XYZ"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user