diff options
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 |