diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index 3165bd61f..748bf6bac 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -3400,11 +3400,6 @@ get_config() { g_hostname=$(hostname 2> /dev/null) - IP=$(mywhich ip 2> /dev/null) - if [ -z "$IP" ] ; then - fatal_error "Can't find ip executable" - fi - if [ -n "$IPSET" ]; then case "$IPSET" in */*) @@ -3426,6 +3421,11 @@ 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/lib.cli-std b/Shorewall/lib.cli-std index b818e5d14..f64ea402d 100644 --- a/Shorewall/lib.cli-std +++ b/Shorewall/lib.cli-std @@ -109,25 +109,6 @@ get_config() { g_tool=$IP6TABLES fi - if [ -n "$IP" ]; then - case "$IP" in - */*) - if [ ! -x "$IP" ] ; then - fatal_error "The program specified in IP ($IP) does not exist or is not executable" - fi - ;; - *) - prog="$(mywhich $IP 2> /dev/null)" - if [ -z "$prog" ] ; then - fatal_error "Can't find $IP executable" - fi - IP=$prog - ;; - esac - else - IP='ip' - fi - if [ -n "$IPSET" ]; then case "$IPSET" in */*) @@ -245,6 +226,25 @@ get_config() { fi fi + if [ -n "$IP" ]; then + case "$IP" in + */*) + if [ ! -x "$IP" ] ; then + fatal_error "The program specified in IP ($IP) does not exist or is not executable" + fi + ;; + *) + prog="$(mywhich $IP 2> /dev/null)" + if [ -z "$prog" ] ; then + fatal_error "Can't find $IP executable" + fi + IP=$prog + ;; + esac + else + IP='ip' + fi + case $VERBOSITY in -1|0|1|2) ;;