summaryrefslogtreecommitdiffstats
path: root/src/connections/ethernet
diff options
context:
space:
mode:
authorJim Pryor <profjim@jimpryor.net>2009-08-11 14:05:01 +0200
committerJames Rayner <james@archlinux.org>2009-08-15 04:28:27 +0200
commitefc7183790cec4fc2b3425f17201e0e2fea51c44 (patch)
tree3f50a28ee89f2ce23571a506c0ea684863aba18d /src/connections/ethernet
parent77f132cb6eb6b2f6514635862f41254bdaf461ac (diff)
downloadnetctl-efc7183790cec4fc2b3425f17201e0e2fea51c44.tar.gz
netctl-efc7183790cec4fc2b3425f17201e0e2fea51c44.tar.xz
Improve debugging and error-reporting.
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src/connections/ethernet')
-rw-r--r--src/connections/ethernet7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/connections/ethernet b/src/connections/ethernet
index 08093a5..935bf8b 100644
--- a/src/connections/ethernet
+++ b/src/connections/ethernet
@@ -51,7 +51,8 @@ ethernet_up() {
[[ -n "$DNS1" || -n "$DNS" ]] && DHCP_OPTIONS="-C resolv.conf $DHCP_OPTIONS"
# Start dhcpcd
report_debug ethernet_up dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCP_OPTIONS "$INTERFACE"
- if ! dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCP_OPTIONS "$INTERFACE"; then
+ dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCP_OPTIONS "$INTERFACE" 2>&1 | report_debug $(cat)
+ if [[ "$PIPESTATUS" -ne 0 ]]; then
report_fail "DHCP IP lease attempt failed."
return 1
fi
@@ -72,7 +73,7 @@ ethernet_up() {
if [[ -n "$GATEWAY" ]]; then
report_debug ethernet_up route add default gw "$GATEWAY"
if ! route add default gw $GATEWAY; then
- report_fail "Adding gateway failed."
+ report_fail "Adding gateway $GATEWAY failed."
return 1
fi
fi
@@ -122,7 +123,7 @@ ethernet_down() {
else
if [[ -f /var/run/dhcpcd-${INTERFACE}.pid ]]; then
report_debug ethernet_down dhcpcd -qx "$INTERFACE"
- dhcpcd -qx "$INTERFACE"
+ dhcpcd -qx "$INTERFACE" &>/dev/null
fi
fi
;;