Fix Error check and error message style

This commit is contained in:
justin 2026-01-27 20:41:55 -05:00 committed by Michel Roegl-Brunner
parent 8c4f1ce531
commit 000a7a2701

View File

@ -3092,9 +3092,8 @@ check_container_resources() {
check_container_storage() {
usage=$(df / -P | awk 'NR==2 {print $5}' | tr -d '%')
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
echo "Error: Failed to check disk usage."
if [ -z "$usage" ] || [ "$usage" -lt 0 ]; then
echo -e "${CROSS}${HOLD}${RD}Error: Failed to check disk usage.${CL}"
exit 1
fi
@ -3104,9 +3103,7 @@ check_container_storage() {
read -r prompt
case "$prompt" in
[yY][eE][sS] | [yY])
# User input is "yes" or "y"; continue
;;
[yY][eE][sS] | [yY]) ;;
*)
echo -e "${CROSS}${HOLD}${YWB}Exiting based on user input.${CL}"
exit 1