mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-03 14:22:12 +02:00
correct exit codes
This commit is contained in:
@@ -134,7 +134,7 @@ function select_storage() {
|
||||
;;
|
||||
*)
|
||||
msg_error "Invalid storage class."
|
||||
exit 1
|
||||
exit 112
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -156,7 +156,7 @@ function select_storage() {
|
||||
if [ $((${#MENU[@]} / 3)) -eq 0 ]; then
|
||||
msg_warn "'$CONTENT_LABEL' needs to be selected for at least one storage location."
|
||||
msg_error "Unable to detect valid storage location."
|
||||
exit 1
|
||||
if [[ "$CONTENT" == "rootdir" ]]; then exit 119; else exit 120; fi
|
||||
elif [ $((${#MENU[@]} / 3)) -eq 1 ]; then
|
||||
printf ${MENU[0]}
|
||||
else
|
||||
@@ -167,7 +167,7 @@ function select_storage() {
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${MENU[@]}" 3>&1 1>&2 2>&3) || {
|
||||
msg_error "Menu aborted."
|
||||
exit 1
|
||||
exit 254
|
||||
}
|
||||
done
|
||||
printf $STORAGE
|
||||
@@ -186,7 +186,7 @@ msg_info "Using '$CONTAINER_STORAGE' for container storage."
|
||||
msg_info "Downloading LXC template (Patience)"
|
||||
pveam download $TEMPLATE_STORAGE $TEMPLATE >/dev/null || {
|
||||
msg_error "A problem occured while downloading the LXC template."
|
||||
exit 1
|
||||
exit 222
|
||||
}
|
||||
msg_ok "Downloaded LXC template"
|
||||
|
||||
@@ -198,7 +198,7 @@ PCT_OPTIONS=(${PCT_OPTIONS[@]:-${DEFAULT_PCT_OPTIONS[@]}})
|
||||
msg_info "Creating LXC container"
|
||||
pct create $CTID ${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE} "${PCT_OPTIONS[@]}" >/dev/null || {
|
||||
msg_error "A problem occured while trying to create container."
|
||||
exit 1
|
||||
exit 209
|
||||
}
|
||||
msg_ok "Created LXC container"
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ EOF
|
||||
systemctl restart code-server@"$USER"
|
||||
if ! systemctl is-active --quiet code-server@"$USER"; then
|
||||
msg_error "code-server service failed to start."
|
||||
exit 1
|
||||
exit 150
|
||||
fi
|
||||
msg_ok "Installed ${APP}"
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ function install() {
|
||||
msg_ok "Created user 'brew'"
|
||||
else
|
||||
msg_error "Cannot install Homebrew without a non-root user. Exiting."
|
||||
exit 1
|
||||
exit 254
|
||||
fi
|
||||
fi
|
||||
msg_ok "Detected User: $BREW_USER"
|
||||
|
||||
@@ -150,7 +150,7 @@ function ensure_openssl() {
|
||||
$STD apt-get install -y openssl
|
||||
else
|
||||
msg_error "openssl is required but could not be installed automatically."
|
||||
exit 10
|
||||
exit 237
|
||||
fi
|
||||
msg_ok "Installed openssl"
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ detect_codename() {
|
||||
CODENAME="${VERSION_CODENAME:-}"
|
||||
if [[ -z "$CODENAME" ]]; then
|
||||
msg_error "Could not detect Debian codename."
|
||||
exit 71
|
||||
exit 238
|
||||
fi
|
||||
echo "$CODENAME"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user