ip route add default via ${GATEWAY} dev ${DEVICE}
evaluate_retval
+ # has carrier ?
+ if [ ! "$(</sys/class/net/${DEVICE}/carrier)" = "1" ]; then
+ boot_mesg -n "Wait for carrier on ${DEVICE} "
+ for (( i=30; i>1; i-- )) do
+ if [ "$(</sys/class/net/${DEVICE}/carrier)" = "1" ]; then
+ break;
+ fi
+ boot_mesg -n "."
+ sleep 2
+ done
+ boot_mesg ""
+ if [ ! "$(</sys/class/net/${DEVICE}/carrier)" = "1" ]; then
+ echo_failure
+ else
+ echo_ok
+ fi
+ fi
+
run_subdir ${rc_base}/init.d/networking/red.up/
# Configure aliases only if red static
;;
stop)
+ rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
+
if [ "$TYPE" == "STATIC" ]; then
boot_mesg "Stopping default gateway ${GATEWAY}..."
ip route del default via ${GATEWAY} >/dev/null 2>&1
## Disable vnstat collection
/usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1
- rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
exit 0;
;;
esac