bastille: Some commands should not support parallel mode

This commit is contained in:
tschettervictor
2025-04-06 16:57:20 -06:00
committed by GitHub
parent c0574c28d0
commit 78e7d881cf

View File

@@ -188,6 +188,7 @@ while [ "$#" -gt 0 ]; do
;;
esac
done
if [ "$#" -lt 1 ]; then
usage
else
@@ -195,51 +196,51 @@ else
shift
fi
# Handle special-case commands first.
# Handle sub-commands.
case "${CMD}" in
# Commands that don't allow parallel mode
bootstrap| \
clone| \
cmd| \
config| \
console| \
convert| \
cp| \
create| \
destroy| \
edit| \
etcupdate| \
export| \
htop| \
jcp | \
import| \
limits| \
list| \
mount| \
network| \
pkg| \
rcp| \
rdr| \
rename| \
setup| \
top| \
verify| \
zfs)
if [ "${PARALLEL_MODE}" -eq 1 ]; then
error_exit "Command does not support parallel mode: ${CMD}"
fi
;;
# Commands that allow parallel mode
cmd| \
config| \
destroy| \
etcupdate| \
limits| \
mount| \
pkg| \
restart| \
service| \
setup| \
start| \
stop| \
sysrc| \
tags| \
template| \
top| \
umount| \
update| \
upgrade| \
verify| \
zfs)
;;
*)
usage
;;
esac
upgrade)
# Extract JAILS from command for parallel mode
OPTIONS=""
while [ "$#" -gt 0 ] && [ "${PARALLEL_MODE}" -eq 1 ]; do
@@ -259,6 +260,11 @@ while [ "$#" -gt 0 ] && [ "${PARALLEL_MODE}" -eq 1 ]; do
fi
esac
done
;;
*)
usage
;;
esac
# shellcheck disable=SC2154
SCRIPTPATH="${bastille_sharedir}/${CMD}.sh"