echo_failure
exit 1
fi
+
+ # Create & Enable vnstat data collection
+ /usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..."
ip addr add ${args} dev ${DEVICE}
;;
stop)
- boot_mesg "Removing IPv4 address ${ADDRESS} from the ${DEVICE} interface..."
- ip addr del ${args} dev ${DEVICE}
+ boot_mesg "Removing IPv4 addresses from the ${DEVICE} interface..."
+ ip addr flush dev ${DEVICE}
evaluate_retval
+
+ # Disable vnstat collection
+ /usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1
+ exit 0;
;;
-
esac
-
# End