diff options
author | James Rayner <james@archlinux.org> | 2009-09-07 12:00:22 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2009-09-07 12:00:22 +0200 |
commit | 13406e34b1179d748b98791d1a15387ba053a4fa (patch) | |
tree | 4af421b5703462b43929fe56a23808d1680d28da /src/connections/ethernet-iproute | |
parent | 3ae7e093c27350ced6ffaf99a3bca6bc56c559b8 (diff) | |
download | netctl-13406e34b1179d748b98791d1a15387ba053a4fa.tar.gz netctl-13406e34b1179d748b98791d1a15387ba053a4fa.tar.xz |
Lots of little tweaks that should never hurt. Some of them may help in
corner cases; others probably make no difference.
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src/connections/ethernet-iproute')
-rw-r--r-- | src/connections/ethernet-iproute | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/connections/ethernet-iproute b/src/connections/ethernet-iproute index 385e128..eedda15 100644 --- a/src/connections/ethernet-iproute +++ b/src/connections/ethernet-iproute @@ -20,12 +20,13 @@ ethernet_up() { report_debug ethernet_iproute_up ifup set_interface up "$INTERFACE" + if ip link show dev "$INTERFACE" | fgrep -q "NO-CARRIER"; then report_iproute "No connection" fi if checkyesno "${AUTH8021X:-no}"; then - . "${SUBR_DIR}/8021x" + . "$SUBR_DIR/8021x" [[ -z "$WPA_CONF" ]] && WPA_CONF="/etc/wpa_supplicant.conf" [[ -z "$WPA_OPTS" ]] && WPA_OPTS="-Dwired" @@ -47,7 +48,7 @@ ethernet_up() { case "$IP" in dhcp) # Clear remaining pid files. - rm -f "/var/run/dhcpcd-${INTERFACE}".{pid,cache} >/dev/null 2>&1 + rm -f "/var/run/dhcpcd-$INTERFACE".{pid,cache} >/dev/null 2>&1 # If using own dns, tell dhcpcd to NOT replace resolv.conf [[ -n "$DNS" ]] && DHCP_OPTIONS="-C resolv.conf $DHCP_OPTIONS" @@ -61,7 +62,7 @@ ethernet_up() { static) if [[ -n "$ADDR" ]]; then report_debug ethernet_iproute_up ip addr add "$ADDR/24" brd + dev "$INTERFACE" - if ! ip addr add "${ADDR}/24" brd + dev "$INTERFACE"; then + if ! ip addr add "$ADDR/24" brd + dev "$INTERFACE"; then report_iproute "Could not configure interface" fi fi @@ -73,7 +74,7 @@ ethernet_up() { fi ;; *) - report_iproute "Profile error: IP must be either 'dhcp' or 'static'" + report_iproute "IP must be either 'dhcp' or 'static'" ;; esac @@ -91,7 +92,7 @@ ethernet_up() { if [[ -n "$HOSTNAME" ]]; then report_debug ethernet_iproute_up hostname "$HOSTNAME" if ! hostname "$HOSTNAME"; then - report_iproute "Cannot set hostname" + report_iproute "Cannot set hostname to $HOSTNAME" fi fi |