diff --git a/usr/local/share/bastille/clone.sh b/usr/local/share/bastille/clone.sh index aeb05cf7..eabcc0ef 100644 --- a/usr/local/share/bastille/clone.sh +++ b/usr/local/share/bastille/clone.sh @@ -150,7 +150,7 @@ update_jailconf() { fi if grep -qw "vnet;" "${JAIL_CONFIG}"; then - validate_netconf || error_exit "[ERROR]: Failed to validate Bastille network configuration." + validate_netconf update_jailconf_vnet else _ip4="$(bastille config ${TARGET} get ip4.addr | sed 's/,/ /g')" diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index a127c100..53dd0fea 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -419,7 +419,7 @@ EOF validate_netconf() { if [ -n "${bastille_network_loopback}" ] && [ -n "${bastille_network_shared}" ]; then - error_exit "Invalid network configuration." + error_exit "[ERROR]: 'bastille_network_loopback' and 'bastille_network_shared' cannot both be set." fi if [ "${bastille_network_vnet_type}" != "if_bridge" ] && [ "${bastille_network_vnet_type}" != "netgraph" ]; then error_exit "[ERROR]: 'bastille_network_vnet_type' not set properly: ${bastille_network_vnet_type}" diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index a4e89313..0d6def87 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -957,18 +957,18 @@ if [ -z "${EMPTY_JAIL}" ]; then ## check if interface is valid if [ -n "${INTERFACE}" ]; then validate_netif - validate_netconf || error_exit "[ERROR]: Failed to validate Bastille network configuration." + validate_netconf elif [ -n "${VNET_JAIL}" ]; then if [ -z "${INTERFACE}" ]; then if [ -z "${bastille_network_shared}" ]; then # User must specify interface on vnet jails. error_exit "Error: Network interface not defined." else - validate_netconf || error_exit "[ERROR]: Failed to validate Bastille network configuration." + validate_netconf fi fi else - validate_netconf || error_exit "[ERROR]: Failed to validate Bastille network configuration." + validate_netconf fi else info "Creating empty jail: ${NAME}." diff --git a/usr/local/share/bastille/network.sh b/usr/local/share/bastille/network.sh index d347b781..bfdcc59b 100644 --- a/usr/local/share/bastille/network.sh +++ b/usr/local/share/bastille/network.sh @@ -560,7 +560,7 @@ add_vlan() { case "${ACTION}" in add) - validate_netconf || error_exit "[ERROR]: Failed to validate Bastille network configuration." + validate_netconf validate_netif "${INTERFACE}" if check_interface_added "${TARGET}" "${INTERFACE}" && [ -z "${VLAN_ID}" ]; then error_exit "Interface is already added: \"${INTERFACE}\""