allow ip to be in /sbin or /bin
This makes it possible for the "ip" program in iproute2 to be installed in /sbin or /bin.
This commit is contained in:
parent
1cdf85e1ce
commit
d3ccbdb5a9
@ -63,7 +63,7 @@ tentative()
|
||||
|
||||
case "$RC_UNAME" in
|
||||
Linux)
|
||||
[ -x /sbin/ip ] || return 1
|
||||
[ -x /sbin/ip ] || [ -x /bin/ip ] || return 1
|
||||
[ -n "$(ip -f inet6 addr show tentative)" ]
|
||||
;;
|
||||
*)
|
||||
@ -161,7 +161,7 @@ runip()
|
||||
routeflush()
|
||||
{
|
||||
if [ "$RC_UNAME" = Linux ]; then
|
||||
if [ -x /sbin/ip ]; then
|
||||
if [ -x /sbin/ip ] || [ -x /bin/ip ]; then
|
||||
ip route flush scope global
|
||||
ip route delete default 2>/dev/null
|
||||
else
|
||||
@ -338,7 +338,7 @@ stop()
|
||||
then
|
||||
veinfo "$int"
|
||||
runargs /etc/ifdown."$int" "$downcmd"
|
||||
if [ -x /sbin/ip ]; then
|
||||
if [ -x /sbin/ip ] || [ -x /bin/ip ]; then
|
||||
# We need to do this, otherwise we may
|
||||
# fail to add things correctly on restart
|
||||
ip address flush dev "$int" 2>/dev/null
|
||||
|
@ -1,9 +1,18 @@
|
||||
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
|
||||
# All rights reserved. Released under the 2-clause BSD license.
|
||||
|
||||
_ip()
|
||||
{
|
||||
if [ -x /bin/ip ]; then
|
||||
echo /bin/ip
|
||||
else
|
||||
echo /sbin/ip
|
||||
fi
|
||||
}
|
||||
|
||||
iproute2_depend()
|
||||
{
|
||||
program /sbin/ip
|
||||
program $(_ip)
|
||||
provide interface
|
||||
after ifconfig
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user