]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Fix vnstat collection for red/dhcp
authorArne Fitzenreiter <arne_f@ipfire.org>
Tue, 16 Sep 2008 22:14:40 +0000 (00:14 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 16 Sep 2008 22:14:40 +0000 (00:14 +0200)
src/initscripts/init.d/networking/red

index 20e052a353e1ba6b5debee3bc245afdefc91af03..5efb5cab2d3662a7764d4d5cb1de48b1b88de7bc 100644 (file)
@@ -119,6 +119,9 @@ case "${1}" in
                        boot_mesg -n "Starting dhcpcd on the ${DEVICE} interface..."            
                        echo -n "${DEVICE}" > /var/ipfire/red/iface
 
+                       ## Create & Enable vnstat
+                       /usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
+
                        # Test to see if there is a stale pid file
                        if [ -f "$PIDFILE" ]; then
                                ps `cat "$PIDFILE"` | grep dhcpcd > /dev/null
@@ -373,7 +376,10 @@ case "${1}" in
                                echo_warning
                                exit 1
                        fi
-               
+                       
+                       ## Disable vnstat collection
+                       /usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1
+
                elif [ "$TYPE" == "PPPOE" ]; then
                        boot_mesg "Bringing down the PPP interface ..."
                        ## Disable vnstat collection