dhclient's --timeout option is not upstream, so a pre-check is needed before
using it.
_timeout=$(getarg rd.net.timeout.dhcp=)
_DHCPRETRY=$(getargnum 1 1 1000000000 rd.net.dhcp.retry=)
+ if [ -n "$_timeout" ]; then
+ if ! (dhclient --help 2>&1 | grep -q -F -- '--timeout' 2> /dev/null); then
+ warn "rd.net.timeout.dhcp has no effect because dhclient does not implement the --timeout option"
+ unset _timeout
+ fi
+ fi
+
while [ $_COUNT -lt "$_DHCPRETRY" ]; do
info "Starting dhcp for interface $netif"
dhclient "$arg" \
return 1
fi
+ if [ -n "$_timeout" ]; then
+ if ! (dhclient --help 2>&1 | grep -q -F -- '--timeout' 2> /dev/null); then
+ warn "rd.net.timeout.dhcp has no effect because dhclient does not implement the --timeout option"
+ unset _timeout
+ fi
+ fi
+
if [ ! -e /run/NetworkManager/conf.d/10-dracut-dhclient.conf ]; then
mkdir -p /run/NetworkManager/conf.d
echo '[main]' > /run/NetworkManager/conf.d/10-dracut-dhclient.conf