mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-20 17:20:12 +01:00
Extra validation on Linux Jails, revert cp.sh to avoid issues with templates
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user