From 820d9295b51e427f3e17c9e83227a127ef9b7631 Mon Sep 17 00:00:00 2001 From: James Rayner Date: Mon, 7 Sep 2009 22:29:56 +1000 Subject: Rework rfkill into re-usable functions --- src/connections/ethernet | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/connections/ethernet') diff --git a/src/connections/ethernet b/src/connections/ethernet index dd07667..5414c69 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -9,7 +9,7 @@ ethernet_up() { report_fail "interface $INTERFACE does not exist" return 1 fi - fi + fi report_debug ethernet_up ifup set_interface up-old "$INTERFACE" @@ -20,7 +20,7 @@ ethernet_up() { return 1 fi - if checkyesno "${AUTH8021X:-no}"; then + if checkyesno "${AUTH8021X:-no}"; then . "$SUBR_DIR/8021x" [[ -z "$WPA_CONF" ]] && WPA_CONF="/etc/wpa_supplicant.conf" [[ -z "$WPA_OPTS" ]] && WPA_OPTS="-Dwired" @@ -35,7 +35,7 @@ ethernet_up() { set_interface forcedown-old "$INTERFACE" report_fail "WPA Authentication/Association Failed" return 1 - fi + fi fi case "$IP" in @@ -48,7 +48,7 @@ ethernet_up() { return 1 fi else - # Clear remaining pid files. + # Clear remaining pid files. rm -f "/var/run/dhcpcd-$INTERFACE".{pid,cache} >/dev/null 2>&1 # If using own dns, tell dhcpcd to NOT replace resolv.conf [[ -n "$DNS1" || -n "$DNS" ]] && DHCP_OPTIONS="-C resolv.conf $DHCP_OPTIONS" @@ -58,10 +58,10 @@ ethernet_up() { if [[ "$PIPESTATUS" -ne 0 ]]; then report_fail "DHCP IP lease attempt failed." return 1 - fi + fi fi if [[ -n "$IFOPTS" ]]; then - report_debug ethernet_up ifup $IFOPTS + report_debug ethernet_up ifup $IFOPTS ifconfig "$INTERFACE" $IFOPTS fi ;; @@ -82,7 +82,7 @@ ethernet_up() { set_interface forcedown-old "$INTERFACE" report_fail "Adding gateway $GATEWAY failed." return 1 - fi + fi fi ;; *) @@ -103,7 +103,7 @@ ethernet_up() { # Generate a new resolv.conf if [[ -n "$DNS1" || -n "$DNS" ]]; then - : >/etc/resolv.conf + : >/etc/resolv.conf [[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc/resolv.conf [[ -n "$SEARCH" ]] && echo "search $SEARCH" >>/etc/resolv.conf [[ -n "$DNS1" ]] && echo "nameserver $DNS1" >>/etc/resolv.conf @@ -141,7 +141,7 @@ ethernet_down() { fi ;; esac - + report_debug ethernet_down ifdown # ignore quirk nodown---is that appropriate? # this adds a flush call as well---is that appropriate? @@ -158,3 +158,4 @@ ethernet_status() { ethernet_$1 "$2" exit $? # vim: set ts=4 et sw=4: + -- cgit v1.2.3-24-g4f1b