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 | |
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')
-rw-r--r-- | src/connections/ethernet | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/connections/ethernet b/src/connections/ethernet index 22405ad..5985ce5 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -4,8 +4,8 @@ ethernet_up() { load_profile "$1" - if [[ ! -e /sys/class/net/"$INTERFACE" ]]; then - if ! echo "$INTERFACE"| fgrep ":"; then + if [[ ! -e "/sys/class/net/$INTERFACE" ]]; then + if ! echo "$INTERFACE" | fgrep -q ":"; then report_fail "interface $INTERFACE does not exist" return 1 fi @@ -21,7 +21,7 @@ ethernet_up() { 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" report_debug ethernet_up start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS" @@ -49,7 +49,7 @@ ethernet_up() { fi else # 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 "$DNS1" || -n "$DNS" ]] && DHCP_OPTIONS="-C resolv.conf $DHCP_OPTIONS" # Start dhcpcd @@ -86,7 +86,7 @@ ethernet_up() { fi ;; *) - report_fail "IP=\"\" must be either 'dhcp' or 'static'." + report_fail "IP must be either 'dhcp' or 'static'." return 1 ;; esac @@ -95,13 +95,13 @@ ethernet_up() { if [[ -n "$HOSTNAME" ]]; then report_debug ethernet_up hostname "$HOSTNAME" if ! hostname "$HOSTNAME"; then - report_fail "Setting hostname failed." + report_fail "Setting hostname $HOSTNAME failed." return 1 fi fi # Generate a new resolv.conf - if [[ -n "$DNS1" ]] || [[ -n "$DNS" ]]; then + if [[ -n "$DNS1" || -n "$DNS" ]]; then : >/etc/resolv.conf [[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc/resolv.conf |