Created
November 28, 2017 15:48
-
-
Save PastaGringo/c02192b5d9b85d460cf963c66f74e22d to your computer and use it in GitHub Desktop.
Reset QuickBox Dashboard bandwith details
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
interfaces=$(ls /var/lib/vnstat) | |
echo | |
echo "Resetting QuickBox Dashboard bandwith details..." | |
service vnstat stop | |
for interface in $interfaces | |
do | |
rm -rf "/var/lib/vnstat/$interface" "/var/lib/vnstat/.$interface" | |
/usr/bin/vnstat -u -i $interface &> /dev/null | |
done | |
chown -R vnstat:vnstat /var/lib/vnstat | |
service vnstat start | |
echo -e "\e[32mSuccess.\e[39m" | |
echo -e "\e[33mThe dashboard needs few minutes to display data again.\e[39m" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment