summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-04-03 12:21:19 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2012-04-03 12:21:19 +0200
commitd560b09b823e5094af9cd6148acd115bfb2c2f41 (patch)
treec6312e55fe65b320fb15b4d0279e6edc3b623479 /scripts
parent3fab6603d9e31b8887e2d7787edd3da32df425e9 (diff)
downloadnetctl-d560b09b823e5094af9cd6148acd115bfb2c2f41.tar.gz
netctl-d560b09b823e5094af9cd6148acd115bfb2c2f41.tar.xz
auto-wireless: improve dhcpcd call
- Use "-K" to prevent unnecessary remove/re-acquire a lease. - Respect /etc/network.d/interfaces/$interface and the dhcp options set there when connecting without a matching profile. Also use the same options used in $CONN_DIR/ethernet. Fixes by Thomas Bächler
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/netcfg-wpa_actiond-action6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/netcfg-wpa_actiond-action b/scripts/netcfg-wpa_actiond-action
index 3547fef..1f29364 100755
--- a/scripts/netcfg-wpa_actiond-action
+++ b/scripts/netcfg-wpa_actiond-action
@@ -11,10 +11,12 @@ action="$4"
case $action in
CONNECT)
if [[ -z $profile ]]; then
- dhcpcd "$interface"
+ # Load interface specific config
+ [[ -f "$IFACE_DIR/$interface" ]] && source "$IFACE_DIR/$interface"
+ dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" -K $DHCP_OPTIONS "$interface"
exit $?
fi
- if ! $CONN_DIR/ethernet up "$profile"; then
+ if ! DHCPCD_INTERNAL_OPTIONS="-K" $CONN_DIR/ethernet up "$profile"; then
exit 1 # what to do if fail?
fi