Don't complain if the 'ip' executable doesn't exist.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2015-01-09 12:20:51 -08:00
parent 97846e14de
commit 740e19968b
2 changed files with 1 additions and 4 deletions

View File

@ -3422,9 +3422,6 @@ get_config() {
TC=tc
IP=$(mywhich ip 2> /dev/null)
if [ -z "$IP" ] ; then
fatal_error "Can't find ip executable"
fi
g_loopback=$(find_loopback_interfaces)

View File

@ -658,7 +658,7 @@ loopback_interface() { #$1 = Interface name
find_loopback_interfaces() {
local interfaces
interfaces=$($IP link show | fgrep LOOPBACK | sed 's/://g' | cut -d ' ' -f 2)
[ -x "$IP" ] && interfaces=$($IP link show | fgrep LOOPBACK | sed 's/://g' | cut -d ' ' -f 2)
[ -n "$interfaces" ] && echo $interfaces || echo lo
}