exit 1
fi
fi
+
+ ## Create & Enable vnstat
+ /usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
if [ "${TYPE}" == "STATIC" ]; then
echo -n "${DEVICE}" > /var/ipfire/red/iface
echo -n "${ADDRESS}" > /var/ipfire/red/local-ipaddress
echo -n "${GATEWAY}" > /var/ipfire/red/remote-ipaddress
+ grep -v "gateway" /etc/hosts > /tmp/hosts
+ echo "$GATEWAY gateway" >> /tmp/hosts
+ mv /tmp/hosts /etc/hosts
echo -n "${DNS1}" > /var/ipfire/red/dns1
echo -n "${DNS2}" > /var/ipfire/red/dns2
touch /var/ipfire/red/active
. /var/ipfire/dhcpc/dhcpcd-${DEVICE}.info
echo "$IPADDR" > /var/ipfire/red/local-ipaddress
+ grep -v "gateway" /etc/hosts > /tmp/hosts
+ echo "$GATEWAY gateway" >> /tmp/hosts
+ mv /tmp/hosts /etc/hosts
echo "$GATEWAY" > /var/ipfire/red/remote-ipaddress
else
echo ""
evaluate_retval
# echo PPP: /usr/sbin/pppd pty "$PPPOE_CMD" $PPP_STD_OPTIONS $DEBUG $DEMAND $PPPD_SYNC
fi
-
+ ## Create & Enable vnstat
+ /usr/bin/vnstat -u -i ppp0 -r --enable --force > /dev/null 2>&1
/etc/rc.d/init.d/connectd start
fi
elif [ "$TYPE" == "PPPOE" ]; then
boot_mesg "Bringing down the PPP interface ..."
+ ## Disable vnstat collection
+ /usr/bin/vnstat -u -i ppp0 -r --disable > /dev/null 2>&1
rm -f /var/ipfire/red/keepconnected
killall -w -s TERM /usr/sbin/pppd 2>/dev/null
evaluate_retval
killall -w -s KILL /usr/sbin/pppd >/dev/null 2>&1
killall -w -s KILL br2684ctl >/dev/null 2>&1
rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
+
+ ## Disable vnstat collection
+ /usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1
+ exit 0;
;;
-
esac
# End