diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 144936de..8c951e5f 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -292,6 +292,12 @@ case "${TYPE}" in ;; esac +## don't allow for dots(.) in container names +if [ $(echo "${NAME}" | grep "[.]") ]; then + echo -e "${COLOR_RED}Container names may not contain a dot(.)!${COLOR_RESET}" + exit 1 +fi + ## verify release case "${RELEASE}" in *-RELEASE|*-release|*-RC1|*-rc1|*-RC2|*-rc2) diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index 78858f52..b023c35e 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -40,7 +40,7 @@ destroy_jail() { bastille_jail_base="${bastille_jailsdir}/${NAME}" ## dir bastille_jail_log="${bastille_logsdir}/${NAME}_console.log" ## file - if [ $(jls name | grep ${NAME}) ]; then + if [ $(jls name | grep -w "${NAME}") ]; then echo -e "${COLOR_RED}Jail running.${COLOR_RESET}" echo -e "${COLOR_RED}See 'bastille stop ${NAME}'.${COLOR_RESET}" exit 1 diff --git a/usr/local/share/bastille/start.sh b/usr/local/share/bastille/start.sh index 4b1e9d05..957cd20e 100644 --- a/usr/local/share/bastille/start.sh +++ b/usr/local/share/bastille/start.sh @@ -51,7 +51,7 @@ if [ "$1" = 'ALL' ]; then JAILS=$(/usr/local/bin/bastille list jails) fi if [ "$1" != 'ALL' ]; then - JAILS=$(/usr/local/bin/bastille list jails | grep "$1") + JAILS=$(/usr/local/bin/bastille list jails | grep -w "$1") fi for _jail in ${JAILS}; do diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index 75c05ede..cd47e1e0 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -51,7 +51,7 @@ if [ "$1" = 'ALL' ]; then JAILS=$(jls name) fi if [ "$1" != 'ALL' ]; then - JAILS=$(jls name | grep -E "(^|\b)${1}($|\b)") + JAILS=$(jls name | grep -w "$1") fi for _jail in ${JAILS}; do