X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Finitscripts%2Finit.d%2Fnetworking%2Fred;h=f90e07378d5d3767d91f3a1a862fb5f282471681;hp=aa5108a77adc2ead80603099b29a35ee2689fec7;hb=f6a6ea8d5ea0bf9a9344d99b0715e5a3fad1476a;hpb=1f2ff0fa894769aee513f6163b0827d054c8720a diff --git a/src/initscripts/init.d/networking/red b/src/initscripts/init.d/networking/red index aa5108a77a..f90e07378d 100644 --- a/src/initscripts/init.d/networking/red +++ b/src/initscripts/init.d/networking/red @@ -122,8 +122,40 @@ case "${1}" in evaluate_retval run_subdir ${rc_base}/init.d/networking/red.up/ - + + # Configure aliases only if red static + /usr/local/bin/setaliases + elif [ "${TYPE}" == "DHCP" ]; then + + if [ -e $LEASEINFO ]; then + boot_mesg -n "Stopping dhcpcd on the ${DEVICE} interface..." + . $LEASEINFO + if [ "$LEASETIME" = "4294967295" ]; then + # do nothing, just echo ok + echo "" + echo_ok + else + if [ -n "$DHCP_STOP" ]; then + /sbin/dhcpcd ${DEVICE} $DHCP_STOP &> /dev/null + RET="$?" + if [ "$RET" -eq 0 ]; then + echo "" + echo_ok + elif [ "$RET" -eq 1 ]; then + boot_mesg "dhcpcd not running!" ${WARNING} + echo_warning + else + echo "" + echo_failure + fi + else + echo "" + killproc dhcpcd + fi + fi + fi + boot_mesg -n "Starting dhcpcd on the ${DEVICE} interface..." echo -n "${DEVICE}" > /var/ipfire/red/iface @@ -180,6 +212,7 @@ case "${1}" in echo "$GATEWAY gateway" >> /tmp/hosts mv /tmp/hosts /etc/hosts echo "$GATEWAY" > /var/ipfire/red/remote-ipaddress + touch /var/ipfire/red/active else echo "" $(exit "$RET") @@ -364,8 +397,8 @@ case "${1}" in /usr/bin/vnstat -u -i ppp0 -r --enable --force > /dev/null 2>&1 /etc/rc.d/init.d/connectd start # Add a NaN value to ppp0 rrd to supress spikes at reconnect - rrdtool $RRDLOG/collectd/localhost/interface/if_octets-ppp0.rrf \ - $(date +%s):: + rrdtool update $RRDLOG/collectd/localhost/interface/if_octets-ppp0.rrd \ + $(date +%s):: > /dev/null 2>&1 exit 0 fi ;; @@ -423,8 +456,8 @@ case "${1}" in killall -w -s TERM /usr/sbin/pppd 2>/dev/null evaluate_retval # Add a NaN value to ppp0 rrd to supress spikes at reconnect - rrdtool $RRDLOG/collectd/localhost/interface/if_octets-ppp0.rrf \ - $(date +%s):: + rrdtool update $RRDLOG/collectd/localhost/interface/if_octets-ppp0.rrd \ + $(date +%s):: > /dev/null 2>&1 fi if [ "$DEVICE" != "${GREEN_DEV}" ] && [ "$DEVICE" != "" ]; then