Merge pull request #73 from ifupdown-ng/feature/udhcpc-hostname-script-client
dhcp: fixes for udhcpc
This commit is contained in:
commit
6048d65d87
1 changed files with 8 additions and 2 deletions
|
@ -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
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue