Merge pull request #261 from cbaecker/non-bastille_vs_ALL

Prevent acting on non-bastille jails when using target ALL
This commit is contained in:
Christer Edwards
2020-11-10 13:07:28 -07:00
committed by GitHub

View File

@@ -145,7 +145,14 @@ clone|cmd|console|convert|cp|edit|export|htop|limits|mount|pkg|rename|service|st
shift
if [ "${TARGET}" = 'ALL' ]; then
JAILS=$(jls name)
_JAILS=$(jls name)
JAILS=""
for _jail in ${_JAILS}; do
_JAILPATH=$(jls -j "${_jail}" path)
if [ -z ${_JAILPATH##${bastille_jailsdir}*} ]; then
JAILS="${JAILS} ${_jail}"
fi
done
else
JAILS=$(jls name | awk "/^${TARGET}$/")