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
boot_mesg "Createing ATM-Bridge as $PPP_NIC ..."
br2684ctl -c0 -e${ENCAP} -a0.${VPI}.${VCI} >/dev/null 2>&1 &
sleep 1
- ifconfig $PPP_NIC up
TYPE="pppoe"
fi
if [ "$TYPE" == "pppoe" ]; then
exit 0
fi
boot_mesg "Bringing up the PPPoE interface on $PPP_NIC ..."
- ip addr add 1.1.1.1/24 broadcast 1.1.1.255 dev $PPP_NIC
+ ip addr flush dev $PPP_NIC >/dev/null 2>&1
+ ip link set ${PPP_NIC} up
else
boot_mesg "Bringing up the PPP via ${TYPE} on ${COMPORT}..."
fi
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
ip route del default via ${GATEWAY} >/dev/null 2>&1
echo_ok
if [ "$DEVICE" != "${GREEN_DEV}" ]; then
- 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
fi
run_subdir ${rc_base}/init.d/networking/red.down/
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
- ip addr del 1.1.1.1/24 broadcast 1.1.1.255 dev ${DEVICE} >/dev/null 2>&1
fi
if [ "$DEVICE" != "${GREEN_DEV}" ] && [ "$DEVICE" != "" ]; then
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