! chkconfig vnstat on &&echo"replace chkconfig with sysv-rc-conf"&& sysv-rc-conf vnstat on
service vnstat start
# Check if vnstat is installed and working properly
vnstat -v
vnstatd -v
# Check if vnstati is installed and working properly
if which vnstati >/dev/null;then
vnstati -v
else
echo"vnstat was compiled and installed without the vnstati tool. If you need to use it, please run 'apt-get install vnstati -y' to install the version from the package repository."
fi
elif["$OS"=="CentOS/Fedora"];then
yum update -y
yum install -y wget sudo curl make gcc sqlite-devel
# Check if vnstat is installed and working properly
vnstat -v
vnstatd -v
# Check if vnstati is installed and working properly
if which vnstati >/dev/null;then
vnstati -v
else
echo"vnstat was compiled and installed without the vnstati tool. If you need to use it, please run 'yum install vnstati -y' or 'dnf install vnstati -y' to install the version from the package repository."