From a57ae3ff46f493e855ae57f60909af7c5c0431d3 Mon Sep 17 00:00:00 2001 From: Lars Engels Date: Wed, 11 Dec 2019 21:17:09 +0100 Subject: [PATCH] Bail out when you try to apply a template to a container that is not started. --- usr/local/share/bastille/template.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index 76edaba3..8710a1f9 100644 --- a/usr/local/share/bastille/template.sh +++ b/usr/local/share/bastille/template.sh @@ -65,6 +65,11 @@ if [ ! -d "${bastille_templatesdir}/${TEMPLATE}" ]; then exit 1 fi +if [ -z "${JAILS}" ]; then + echo -e "${COLOR_RED}Container ${TARGET} is not running.${COLOR_RESET}" + exit 1 +fi + ## global variables bastille_template=${bastille_templatesdir}/${TEMPLATE} for _jail in ${JAILS}; do