diff options
author | James Rayner <james@archlinux.org> | 2008-05-30 15:26:15 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2008-05-30 15:26:15 +0200 |
commit | a57607373a96ef93f82f98e7da4cbe2c8b55caed (patch) | |
tree | e8e3c1a7d529014a2a1339e1ca6fcf406fbb6445 /src | |
parent | cd374f02c9f54b53ac3dd023ac2b698023c00192 (diff) | |
download | netctl-a57607373a96ef93f82f98e7da4cbe2c8b55caed.tar.gz netctl-a57607373a96ef93f82f98e7da4cbe2c8b55caed.tar.xz |
Set dhclient as default if installed
Diffstat (limited to 'src')
-rw-r--r-- | src/ethernet.subr | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ethernet.subr b/src/ethernet.subr index 081d49a..12da9b5 100644 --- a/src/ethernet.subr +++ b/src/ethernet.subr @@ -24,12 +24,13 @@ ethernet_up() { err_append "No connection available" return 1 fi - + case $IP in dhcp) # Check if DHCP_TIMEOUT was set if not set a default value + [[ ! "$DHCLIENT" && -e /sbin/dhclient ]] && DHCLIENT="yes" [[ -z "$DHCP_TIMEOUT" ]] && DHCP_TIMEOUT=10 - + if checkyesno $DHCLIENT; then rm -r /var/run/dhclient-${INTERFACE}.pid >/dev/null 2>&1 if ! dhclient -q -e TIMEOUT=$DHCP_TIMEOUT -pf /var/run/dhclient-${INTERFACE}.pid; then |