mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-21 09:41:47 +01:00
convert: Support -y
This commit is contained in:
@@ -266,18 +266,26 @@ if [ "$#" -eq 1 ]; then
|
|||||||
error_exit "[ERROR]: ${TARGET} is not a thin container."
|
error_exit "[ERROR]: ${TARGET} is not a thin container."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure the user agree with the conversion
|
# Ask if user is sure they want to convert the jail
|
||||||
# Be interactive here since this cannot be easily undone
|
# but only if AUTO_YES=0
|
||||||
while :; do
|
if [ "${AUTO_YES}" -ne 1 ]; then
|
||||||
warn "\n[WARNING]: Jail conversion from thin to thick can't be undone!\n"
|
warn "/n[WARNING]: Jail conversion from thin to thick can't be undone!\n"
|
||||||
# shellcheck disable=SC2162
|
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC3045
|
||||||
read -p "Do you really wish to convert '${TARGET}' into a thick container? [y/N]:" yn
|
read -p "Are you sure you want to continue? [y|n]:" _answer
|
||||||
case ${yn} in
|
case "${_answer}" in
|
||||||
[Yy]) start_convert;;
|
[Yy]|[Yy][Ee][Ss])
|
||||||
[Nn]) exit 0;;
|
start_convert
|
||||||
|
;;
|
||||||
|
[Nn]|[Nn][Oo])
|
||||||
|
error_exit "[ERROR]: Cancelled by user."
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
error_exit "[ERROR]: Invalid input. Please answer 'y' or 'n'."
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
elif [ "${AUTO_YES}" -eq 1 ]; then
|
||||||
|
start_convert
|
||||||
|
fi
|
||||||
|
|
||||||
elif [ "$#" -eq 2 ]; then
|
elif [ "$#" -eq 2 ]; then
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user