From 740e19968be4af8d696231f5975ae7c3729812ac Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 9 Jan 2015 12:20:51 -0800 Subject: [PATCH] Don't complain if the 'ip' executable doesn't exist. Signed-off-by: Tom Eastep --- Shorewall-core/lib.cli | 3 --- Shorewall-core/lib.common | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index 748bf6bac..8ef3a96f0 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -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) diff --git a/Shorewall-core/lib.common b/Shorewall-core/lib.common index ad39baec9..27efef069 100644 --- a/Shorewall-core/lib.common +++ b/Shorewall-core/lib.common @@ -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 }