--- dncpcd.sh.orig 2023-04-17 07:37:32.000000000 +0300 +++ dhcpcd.sh 2023-05-28 16:11:28.068836553 +0300 @@ -50,21 +50,28 @@ nonis) args="${args} -C yp.conf" ;; - nogateway) args="${args} -G";; - nosendhost) args="${args} -h ''"; + nogateway) + args="${args} -G" + ;; + nosendhost) + args="${args} -h ''" + ;; esac done # Add our route metric if not given case " ${args} " in - *" -m "*) ;; - *) [ "${metric:-0}" != 0 ] && args="${args} -m ${metric}";; + *" -m "*) + ;; + *) + [ "${metric:-0}" != 0 ] && args="${args} -m ${metric}" + ;; esac # Bring up DHCP for this interface ebegin "Running dhcpcd" - eval dhcpcd "${args}" "${IFACE}" + printf '%s %s' "${args}" "${IFACE}" | xargs -E '' dhcpcd eend $? || return 1 _show_address @@ -84,14 +91,18 @@ [ -z "${args}" ] && args=${dhcpcd} fi pidfile="$(dhcpcd -P ${args} ${IFACE})" - [ ! -f "${pidfile}" ] && return 0 + [ ! -f "${pidfile}" ] && return 0. ebegin "Stopping dhcpcd on ${IFACE}" eval opts=\$dhcp_${IFVAR} [ -z "${opts}" ] && opts=${dhcp} case " ${opts} " in - *" release "*) dhcpcd -k "${args}" "${IFACE}" ;; - *) dhcpcd -x "${args}" "${IFACE}" ;; + *" release "*) + printf '%s %s' "${args}" "${IFACE}" | xargs -E '' dhcpcd -k + ;; + *) + printf '%s %s' "${args}" "${IFACE}" | xargs -E '' dhcpcd -x + ;; esac [ -f "${argsfile}" ] && rm -f "${argsfile}" eend $?