Match exact jail name for start/stop commands, don't allow for dots during create
This commit is contained in:
@@ -292,6 +292,12 @@ case "${TYPE}" in
|
|||||||
;;
|
;;
|
||||||
esac
|
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
|
## verify release
|
||||||
case "${RELEASE}" in
|
case "${RELEASE}" in
|
||||||
*-RELEASE|*-release|*-RC1|*-rc1|*-RC2|*-rc2)
|
*-RELEASE|*-release|*-RC1|*-rc1|*-RC2|*-rc2)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ destroy_jail() {
|
|||||||
bastille_jail_base="${bastille_jailsdir}/${NAME}" ## dir
|
bastille_jail_base="${bastille_jailsdir}/${NAME}" ## dir
|
||||||
bastille_jail_log="${bastille_logsdir}/${NAME}_console.log" ## file
|
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}Jail running.${COLOR_RESET}"
|
||||||
echo -e "${COLOR_RED}See 'bastille stop ${NAME}'.${COLOR_RESET}"
|
echo -e "${COLOR_RED}See 'bastille stop ${NAME}'.${COLOR_RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ if [ "$1" = 'ALL' ]; then
|
|||||||
JAILS=$(/usr/local/bin/bastille list jails)
|
JAILS=$(/usr/local/bin/bastille list jails)
|
||||||
fi
|
fi
|
||||||
if [ "$1" != 'ALL' ]; then
|
if [ "$1" != 'ALL' ]; then
|
||||||
JAILS=$(/usr/local/bin/bastille list jails | grep "$1")
|
JAILS=$(/usr/local/bin/bastille list jails | grep -w "$1")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for _jail in ${JAILS}; do
|
for _jail in ${JAILS}; do
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ if [ "$1" = 'ALL' ]; then
|
|||||||
JAILS=$(jls name)
|
JAILS=$(jls name)
|
||||||
fi
|
fi
|
||||||
if [ "$1" != 'ALL' ]; then
|
if [ "$1" != 'ALL' ]; then
|
||||||
JAILS=$(jls name | grep -E "(^|\b)${1}($|\b)")
|
JAILS=$(jls name | grep -w "$1")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for _jail in ${JAILS}; do
|
for _jail in ${JAILS}; do
|
||||||
|
|||||||
Reference in New Issue
Block a user