diff --git a/executor-scripts/linux/dhcp b/executor-scripts/linux/dhcp index 783f6e1..82ae793 100755 --- a/executor-scripts/linux/dhcp +++ b/executor-scripts/linux/dhcp @@ -2,6 +2,9 @@ set -e +# some users provide a shell fragment for the hostname property. +[ -n "$IF_HOSTNAME" ] && IF_HOSTNAME=$(eval echo $IF_HOSTNAME) + determine_implementation() { [ -n "$IF_DHCP_PROGRAM" ] && echo "$IF_DHCP_PROGRAM" && return [ -x /sbin/dhcpcd ] && echo "dhcpcd" && return @@ -24,8 +27,11 @@ start() { ${MOCK} /usr/sbin/dhclient -pf /var/run/dhclient.$IFACE.pid $IFACE ;; udhcpc) - UDHCPC_OPTS=$(eval echo $IF_UDHCPC_OPTS) - ${MOCK} /sbin/udhcpc -b -R -p /var/run/udhcpc.$IFACE.pid -i $IFACE $UDHCPC_OPTS + optargs=$(eval echo $IF_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 ;; *) ;;