summaryrefslogtreecommitdiffstats
path: root/src/connections
diff options
context:
space:
mode:
Diffstat (limited to 'src/connections')
-rw-r--r--src/connections/ethernet7
-rw-r--r--src/connections/ethernet-iproute14
-rw-r--r--src/connections/ppp4
3 files changed, 13 insertions, 12 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
;;
diff --git a/src/connections/ethernet-iproute b/src/connections/ethernet-iproute
index 8937f16..046b9a0 100644
--- a/src/connections/ethernet-iproute
+++ b/src/connections/ethernet-iproute
@@ -22,8 +22,7 @@ ethernet_up() {
set_interface up $INTERFACE
if ip link show $INTERFACE | fgrep -q "NO-CARRIER"; then
- report_fail "No connection"
- return 1
+ report_iproute "No connection"
fi
if checkyesno ${AUTH8021X:-no}; then
@@ -53,7 +52,8 @@ ethernet_up() {
[[ -n "$DNS" ]] && DHCP_OPTIONS="-C resolv.conf $DHCP_OPTIONS"
report_debug ethernet_iproute_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_iproute "DHCP IP lease attempt failed"
fi
;;
@@ -67,12 +67,12 @@ ethernet_up() {
if [[ -n "$GATEWAY" ]]; then
report_debug ethernet_iproute_up ip route add default via "$GATEWAY"
if ! ip route add default via $GATEWAY; then
- report_iproute "Adding gateway failed"
+ report_iproute "Adding gateway $GATEWAY failed"
fi
fi
;;
*)
- report_iproute "Profile report_iproute: IP must be either 'dhcp' or 'static'"
+ report_iproute "Profile error: IP must be either 'dhcp' or 'static'"
;;
esac
@@ -81,7 +81,7 @@ ethernet_up() {
report_debug ethernet_iproute_up ip "$line"
if ! ip $line; then
- report_iproute "Could not configure interface"
+ report_iproute "Could not configure interface ($line)."
fi
done
fi
@@ -115,7 +115,7 @@ ethernet_down() {
if [[ "$IP" == "dhcp" ]]; then
if [[ -f /var/run/dhcpcd-${INTERFACE}.pid ]]; then
report_debug ethernet_iproute_down dhcpcd -qx "$INTERFACE"
- dhcpcd -qx $INTERFACE
+ dhcpcd -qx "$INTERFACE" &>/dev/null
fi
fi
diff --git a/src/connections/ppp b/src/connections/ppp
index 9432323..c59db40 100644
--- a/src/connections/ppp
+++ b/src/connections/ppp
@@ -10,8 +10,8 @@ ppp_up() {
/usr/sbin/pppd call $PEER updetach child-timeout $PPP_TIMEOUT linkname $PEER
if [[ $? -ne 0 ]]; then
- err_append "pppd connection failed"
- exit 1
+ report_fail "Couldn't make pppd connection."
+ return 1
fi
}