Merge pull request #73 from ifupdown-ng/feature/udhcpc-hostname-script-client

dhcp: fixes for udhcpc
This commit is contained in:
Ariadne Conill 2020-09-11 02:40:29 -06:00 committed by GitHub
commit 6048d65d87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,9 @@
set -e set -e
# some users provide a shell fragment for the hostname property.
[ -n "$IF_HOSTNAME" ] && IF_HOSTNAME=$(eval echo $IF_HOSTNAME)
determine_implementation() { determine_implementation() {
[ -n "$IF_DHCP_PROGRAM" ] && echo "$IF_DHCP_PROGRAM" && return [ -n "$IF_DHCP_PROGRAM" ] && echo "$IF_DHCP_PROGRAM" && return
[ -x /sbin/dhcpcd ] && echo "dhcpcd" && return [ -x /sbin/dhcpcd ] && echo "dhcpcd" && return
@ -24,8 +27,11 @@ start() {
${MOCK} /usr/sbin/dhclient -pf /var/run/dhclient.$IFACE.pid $IFACE ${MOCK} /usr/sbin/dhclient -pf /var/run/dhclient.$IFACE.pid $IFACE
;; ;;
udhcpc) udhcpc)
UDHCPC_OPTS=$(eval echo $IF_UDHCPC_OPTS) optargs=$(eval echo $IF_UDHCPC_OPTS)
${MOCK} /sbin/udhcpc -b -R -p /var/run/udhcpc.$IFACE.pid -i $IFACE $UDHCPC_OPTS [ -n "$IF_HOSTNAME" ] && optargs="$optargs -x hostname:$IF_HOSTNAME"
[ -n "$IF_CLIENT" ] && optargs="$optargs -c $IF_CLIENT"
[ -n "$IF_SCRIPT" ] && optargs="$optargs -s $IF_SCRIPT"
${MOCK} /sbin/udhcpc -b -R -p /var/run/udhcpc.$IFACE.pid -i $IFACE $optargs
;; ;;
*) *)
;; ;;