Minor code cleanup

This commit is contained in:
Jose
2020-05-09 15:41:34 -04:00
parent f84fd4ad85
commit 8826f53d9a

View File

@@ -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