diff options
author | Remy Bohmer <linux@bohmer.net> | 2010-05-29 22:59:13 +0200 |
---|---|---|
committer | Remy Bohmer <linux@bohmer.net> | 2010-06-02 21:09:28 +0200 |
commit | 498bbb2007d08d3841c9571e9e230256263a1852 (patch) | |
tree | 4535b0b89380f12bdfe2c391d36f77f7cb75eb19 /generic | |
parent | d7ea2c2e52a9313af287a84fe18e0e70268d06a0 (diff) | |
download | ptxdist-498bbb2007d08d3841c9571e9e230256263a1852.tar.gz ptxdist-498bbb2007d08d3841c9571e9e230256263a1852.tar.xz |
[dhclient] Configure path in dhclient-script
If the dhclient-script is executed by the init.d scripts the PATH is not
yet set and the path of, for example, 'ip' differs if iproute2 (/sbin) or
busybox (/bin) is being used. so set the path of the possible locations of
the tools to make sure the tools can be found
Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
Signed-off-by: Remy Bohmer <linux@bohmer.net>
Diffstat (limited to 'generic')
-rw-r--r-- | generic/etc/dhclient-script | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/generic/etc/dhclient-script b/generic/etc/dhclient-script index 8b4d7a4a2..555437158 100644 --- a/generic/etc/dhclient-script +++ b/generic/etc/dhclient-script @@ -22,8 +22,10 @@ # 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious # of the $1 in its args. -# 'ip' just looks too weird. /sbin/ip looks less weird. -ip=/sbin/ip +# busybox installs /bin/ip but iproute2 installs /sbin/ip, so put all the +# possible locations of ip, ifconfig and route in the PATH to make sure +# these tools can be found. +PATH=/sbin:/usr/sbin:/bin:/usr/bin make_resolv_conf() { if [ x"$new_domain_name_servers" != x ]; then @@ -235,10 +237,10 @@ fi if [ ${reason} = PREINIT6 ] ; then # Ensure interface is up. - ${ip} link set ${interface} up + ip link set ${interface} up # Remove any stale addresses from aborted clients. - ${ip} -f inet6 addr flush dev ${interface} scope global permanent + ip -f inet6 addr flush dev ${interface} scope global permanent exit_with_hooks 0 fi @@ -254,7 +256,7 @@ if [ ${reason} = BOUND6 ] ; then exit_with_hooks 2; fi - ${ip} -f inet6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \ + ip -f inet6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \ dev ${interface} scope global # Check for nameserver options. @@ -280,7 +282,7 @@ if [ ${reason} = DEPREF6 ] ; then exit_with_hooks 2; fi - ${ip} -f inet6 addr change ${new_ip6_address}/${new_ip6_prefixlen} \ + ip -f inet6 addr change ${new_ip6_address}/${new_ip6_prefixlen} \ dev ${interface} scope global preferred_lft 0 exit_with_hooks 0 @@ -291,7 +293,7 @@ if [ ${reason} = EXPIRE6 -o ${reason} = RELEASE6 -o ${reason} = STOP6 ] ; then exit_with_hooks 2; fi - ${ip} -f inet6 addr del ${old_ip6_address}/${old_ip6_prefixlen} \ + ip -f inet6 addr del ${old_ip6_address}/${old_ip6_prefixlen} \ dev ${interface} exit_with_hooks 0 |