]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/init.d/networking/any
Change the ip address removal at network stop
[ipfire-2.x.git] / src / initscripts / init.d / networking / any
index 7d2242954944e193fd6532c89b47864c686d4421..b88d21ecf783999b11c6095cba30ebf5f24a7d70 100644 (file)
@@ -76,6 +76,9 @@ case "${1}" in
                        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}
@@ -83,11 +86,13 @@ case "${1}" in
                ;;
 
        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