Fix Error check and error message style
This commit is contained in:
parent
8c4f1ce531
commit
000a7a2701
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user