diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index 0d63907..2cc9038 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -55,15 +55,15 @@ if [ "${TARGET}" = 'ALL' ]; then fi if [ "${TARGET}" != 'ALL' ]; then JAILS=$(jls name | awk "/^${TARGET}$/") + ## test if not running + if [ ! "$(jls name | awk "/^${TARGET}$/")" ]; then + echo -e "${COLOR_RED}[${TARGET}]: Not started.${COLOR_RESET}" + fi fi for _jail in ${JAILS}; do - ## test if not running - if [ ! "$(jls name | awk "/^${_jail}$/")" ]; then - echo -e "${COLOR_RED}[${_jail}]: Not started.${COLOR_RESET}" - ## test if running - elif [ "$(jls name | awk "/^${_jail}$/")" ]; then + if [ "$(jls name | awk "/^${_jail}$/")" ]; then ## remove ip4.addr from firewall table:jails if [ ! -z "${bastille_jail_loopback}" ]; then pfctl -q -t jails -T delete $(jls -j ${_jail} ip4.addr)