From 8826f53d9a0211175b20fb983916efde9553444b Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 9 May 2020 15:41:34 -0400 Subject: [PATCH] Minor code cleanup --- usr/local/share/bastille/rename.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/usr/local/share/bastille/rename.sh b/usr/local/share/bastille/rename.sh index 946157e..501bcf8 100644 --- a/usr/local/share/bastille/rename.sh +++ b/usr/local/share/bastille/rename.sh @@ -43,7 +43,7 @@ error_notify() { } validate_name() { - local NAME_VERIFY=${NAME} + local NAME_VERIFY=${NEWNAME} local NAME_SANITY=$(echo "${NAME_VERIFY}" | tr -c -d 'a-zA-Z0-9-_') if [ "${NAME_VERIFY}" != "${NAME_SANITY}" ]; then error_notify "${COLOR_RED}Container names may not contain special characters!${COLOR_RESET}" @@ -65,11 +65,6 @@ TARGET="${1}" NEWNAME="${2}" shift -if echo "${NEWNAME}" | grep -Eq '[.]|\ '; then - echo -e "${COLOR_RED}Container names may not contain a dot(.) nor spaces!${COLOR_RESET}" - exit 1 -fi - update_jailconf() { # Update jail.conf JAIL_CONFIG="${bastille_jailsdir}/${NEWNAME}/jail.conf" @@ -141,7 +136,7 @@ elif [ -d "${bastille_jailsdir}/${NEWNAME}" ]; then fi ## validate jail name -if [ -n "${NAME}" ]; then +if [ -n "${NEWNAME}" ]; then validate_name fi