From 03597e14890885123d1a65e803290b81620060bd Mon Sep 17 00:00:00 2001 From: Jose Date: Mon, 25 Nov 2019 20:02:56 -0400 Subject: [PATCH] Additional network config checks --- usr/local/share/bastille/create.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 73e9b7e2..918e64d3 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -71,17 +71,21 @@ validate_netif() { } validate_netconf() { + if [ -n "${bastille_jail_loopback}" ] && [ -n "${bastille_jail_interface}" ] && [ -n "${bastille_jail_external}" ]; then + echo -e "${COLOR_RED}Invalid network configuration.${COLOR_RESET}" + exit 1 + fi if [ ! -z "${bastille_jail_external}" ]; then break - elif [ ! -z ${bastille_jail_loopback} ] && [ -z ${bastille_jail_external} ]; then + 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 + 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 + elif [ -z "${bastille_jail_external}" ]; then echo -e "${COLOR_RED}Invalid network configuration.${COLOR_RESET}" exit 1 fi