Extra validation on Linux Jails, revert cp.sh to avoid issues with templates

This commit is contained in:
JRGTH
2021-07-15 16:30:36 -04:00
parent 494d811c32
commit c90fea3066
2 changed files with 10 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ esac
for _jail in ${JAILS}; do
info "[${_jail}]:"
bastille_jail_path="${bastille_jailsdir}/${_jail}/root"
cp "${OPTION}" "${CPSOURCE}" "${bastille_jail_path}${CPDEST}"
cp "${OPTION}" "${CPSOURCE}" "${bastille_jail_path}/${CPDEST}"
RETURN="$?"
if [ "${TARGET}" = "ALL" ]; then
# Display the return status for reference

View File

@@ -113,6 +113,13 @@ validate_netconf() {
}
validate_release() {
## ensure the user set the Linux(experimental) option explicitly
if [ -n "${UBUNTU}" ]; then
if [ -z "${LINUX_JAIL}" ]; then
usage
fi
fi
## check release name match, else show usage
if [ -n "${NAME_VERIFY}" ]; then
RELEASE="${NAME_VERIFY}"
@@ -644,10 +651,12 @@ if [ -z "${EMPTY_JAIL}" ]; then
validate_release
;;
ubuntu_bionic|bionic|ubuntu-bionic)
UBUNTU="1"
NAME_VERIFY=Ubuntu_1804
validate_release
;;
ubuntu_focal|focal|ubuntu-focal)
UBUNTU="1"
NAME_VERIFY=Ubuntu_2004
validate_release
;;