From 29016faf208f851e7064d81553498098541e844d Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 20 Feb 2020 21:08:04 -0400 Subject: [PATCH] Just return `0` if bastille_jail_external is set --- usr/local/share/bastille/create.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index f587c01..81edec2 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -93,19 +93,19 @@ validate_netconf() { echo -e "${COLOR_RED}Invalid network configuration.${COLOR_RESET}" exit 1 fi - if [ -z "${bastille_jail_external}" ]; then - if [ -n "${bastille_jail_loopback}" ] && [ -z "${bastille_jail_external}" ]; then - if [ -z "${bastille_jail_interface}" ]; then - echo -e "${COLOR_RED}Invalid network configuration.${COLOR_RESET}" - exit 1 - fi - elif [ -z "${bastille_jail_loopback}" ] && [ -n "${bastille_jail_interface}" ]; then - echo -e "${COLOR_RED}Invalid network configuration.${COLOR_RESET}" - exit 1 - elif [ -z "${bastille_jail_external}" ]; then + if [ -n "${bastille_jail_external}" ]; then + return 0 + elif [ ! -z "${bastille_jail_loopback}" ] && [ -z "${bastille_jail_external}" ]; then + if [ -z "${bastille_jail_interface}" ]; then echo -e "${COLOR_RED}Invalid network configuration.${COLOR_RESET}" exit 1 fi + elif [ -z "${bastille_jail_loopback}" ] && [ ! -z "${bastille_jail_interface}" ]; then + echo -e "${COLOR_RED}Invalid network configuration.${COLOR_RESET}" + exit 1 + elif [ -z "${bastille_jail_external}" ]; then + echo -e "${COLOR_RED}Invalid network configuration.${COLOR_RESET}" + exit 1 fi }