fi
}
+set_dhcpclient()
+{
+ if [ "$BOOTPROTO" = "bootp" -o "$BOOTPROTO" = "pump" ]; then
+ DHCP_CLIENT=/sbin/pump
+ fi
+
+ if [ -z "$DHCP_CLIENT" ]; then
+ if [ -x /sbin/dhcpcd ]; then
+ DHCP_CLIENT=/sbin/dhcpcd
+ elif [ -x /sbin/dhclient ]; then
+ DHCP_CLIENT=/sbin/dhclient
+ elif [ -x /sbin/dhcpxd ]; then
+ DHCP_CLIENT=/sbin/dhcpxd
+ elif [ -x /sbin/pump ]; then
+ DHCP_CLIENT=/sbin/pump
+ else
+ nls "Can't find a dhcp client."
+ exit 1
+ fi
+ fi
+}
+
# Setup Network Address Translation (NAT)
setup_nat()
{
fi
fi
-if [ "$BOOTPROTO" = "bootp" -o "$BOOTPROTO" = "pump" ]; then
- /sbin/pump -r -i ${DEVICE}
- RESULT=$?
-fi
-
-if [ "$BOOTPROTO" = "dhcp" ]; then
- if [ -x /sbin/dhcpcd ];then
- /sbin/dhcpcd -k ${DEVICE}
- RESULT=$?
- elif [ -x /sbin/dhclient ];then
- if [ -f /var/run/dhclient.pid ];then
- PID=$(cat /var/run/dhclient.pid)
- if ps ax --no-header|grep -q $PID;then
- kill $PID
- RESULT=$?
+if [ -n "$BOOTPROTO" -a "$BOOTPROTO" != "none" -a "$BOOTPROTO" != "static" ]; then
+ if is_yes "$IPV4_NETWORKING"; then
+ set_dhcpclient
+
+ case ${DHCP_CLIENT##*/} in
+ pump)
+ /sbin/pump -r -i ${DEVICE}
+ RESULT=$?
+ ;;
+ dhcpcd)
+ /sbin/dhcpcd -k ${DEVICE}
+ RESULT=$?
+ ;;
+ dhcpxd)
+ /sbin/dhcpxd -k ${DEVICE}
+ RESULT=$?
+ ;;
+ dhclient)
+ if [ -f /var/run/dhclient.pid ];then
+ PID=$(cat /var/run/dhclient.pid)
+ if ps ax --no-header | grep -q $PID; then
+ kill $PID
+ RESULT=$?
+ fi
fi
- fi
- elif [ -x /sbin/dhcpxd ];then
- /sbin/dhcpxd -k ${DEVICE}
- RESULT=$?
- elif [ -x /sbin/pump ];then
- pump -r -i ${DEVICE}
- RESULT=$?
+ ;;
+ esac
+
+ sleep 1 # WHY?
fi
- sleep 1
fi
if is_wireless_device "${DEVICE}"; then
if [ -n "$BOOTPROTO" -a "$BOOTPROTO" != "none" -a "$BOOTPROTO" != "static" ]; then
if is_yes "$IPV4_NETWORKING"; then
- if [ "$BOOTPROTO" = "bootp" -o "$BOOTPROTO" = "pump" ]; then
- DHCP_CLIENT=/sbin/pump
- fi
-
- if [ -z "$DHCP_CLIENT" ]; then
- if [ -x /sbin/dhcpcd ]; then
- DHCP_CLIENT=/sbin/dhcpcd
- elif [ -x /sbin/dhclient ]; then
- DHCP_CLIENT=/sbin/dhclient
- elif [ -x /sbin/dhcpxd ]; then
- DHCP_CLIENT=/sbin/dhcpxd
- elif [ -x /sbin/pump ]; then
- DHCP_CLIENT=/sbin/pump
- else
- nls "Can't find a dhcp client."
- exit 1
- fi
- fi
+ set_dhcpclient
DHCP_ARGS=
if [ -n "$DHCP_CLIENT" ]; then