net.lo: Add the ability to find the full path of a binary
Some of the networking tools, such as iproute2, can be stored in one of several locations. This function gives us a standard way to find these tools. I would like to thankRobin Johnson <robbat2@gentoo.org> for his input on this function.
This commit is contained in:
parent
adde73141f
commit
f2e404ab66
@ -169,6 +169,18 @@ _configure_variables()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_which()
|
||||||
|
{
|
||||||
|
local i OIFS
|
||||||
|
[ -z "$1" ] && return
|
||||||
|
OIFS="$IFS"
|
||||||
|
IFS=:
|
||||||
|
for i in $PATH ; do
|
||||||
|
[ -x $i/$1 ] && echo $i/$1 && break
|
||||||
|
done
|
||||||
|
IFS=$OIFS
|
||||||
|
}
|
||||||
|
|
||||||
_show_address()
|
_show_address()
|
||||||
{
|
{
|
||||||
einfo "received address $(_get_inet_address "${IFACE}")"
|
einfo "received address $(_get_inet_address "${IFACE}")"
|
||||||
|
Loading…
Reference in New Issue
Block a user