mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2026-11-24 23:00:42 +00:00
Update prompts: take the default or skip when nobody can answer (#18931)
Updates run without a terminal (update-apps, pct exec, cron) hit bare read prompts and failed with 'read exited 1'. - komodo, alpine-komodo, dockge, dokploy, runtipi, cockpit: prompt_confirm, so the default (legacy update, no 45Drives extras) applies unattended - bichon (low space), semaphore (BoltDB migration): exit 75 unattended, which update-apps reports as skipped - termix: unattended keeps the current Nginx config - gitea-mirror, jellyseerr, overseerr, paperless-ngx, vikunja, zabbix: the PHS_SILENT guards now use is_unattended, so a missing terminal counts too
This commit is contained in:
1 parent
5419f8178a
commit
b3daceeb96
15 files changed
+24
-22
No files matched your search
+1
-2
@@ -34,8 +34,7 @@ function update_script() {
|
||||
echo -e "${INFO}${YW}This is a one-time migration. After this, you can update ${APP} anytime with:${CL}"
|
||||
echo -e "${TAB}${TAB}${GN}update_komodo${CL} or ${GN}bash <(curl -fsSL ${ADDON_SCRIPT})${CL}"
|
||||
echo ""
|
||||
read -r -p "${TAB}Migrate update function now? [y/N]: " CONFIRM
|
||||
if [[ ! "${CONFIRM,,}" =~ ^(y|yes)$ ]]; then
|
||||
if ! prompt_confirm "${TAB}Migrate update function now?" "n"; then
|
||||
msg_warn "Migration skipped. The old update will continue to work for now."
|
||||
msg_warn "⚠️ Komodo v2 uses :2 image tags. The :latest tag is deprecated and will not receive v2 updates."
|
||||
msg_warn "Please migrate to the addon script to receive Komodo v2."
|
||||
|
||||
@@ -50,6 +50,10 @@ function update_script() {
|
||||
if [[ -n "$STORAGE_KB" && -n "$FREE_KB" && "$FREE_KB" -lt "$STORAGE_KB" ]]; then
|
||||
echo -e "\n${RD}Warning: migration needs about $((STORAGE_KB / 1024))MB, only $((FREE_KB / 1024))MB free.${CL}"
|
||||
echo -e "${RD}The new bichon-blob store is written alongside the existing fjall data.${CL}"
|
||||
if is_unattended; then
|
||||
msg_warn "Not enough free space for the migration - skipping update, requires an interactive run"
|
||||
exit 75
|
||||
fi
|
||||
read -r -p "Are you sure you want to proceed with the update? (y/N): " proceed
|
||||
if [[ ! $proceed =~ ^[Yy]$ ]]; then
|
||||
msg_error "Update cancelled by user."
|
||||
|
||||
+1
-2
@@ -36,8 +36,7 @@ function update_script() {
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
|
||||
if [[ ! -f /etc/apt/sources.list.d/45drives.sources ]]; then
|
||||
[[ "$(arch_resolve)" == "arm64" ]] || read -r -p "Would you like to install 45Drives' cockpit-file-sharing, cockpit-identities, and cockpit-navigator now? <y/N> " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
if [[ "$(arch_resolve)" != "arm64" ]] && prompt_confirm "Would you like to install 45Drives' cockpit-file-sharing, cockpit-identities, and cockpit-navigator now?" "n"; then
|
||||
msg_info "Installing 45Drives' cockpit extensions"
|
||||
setup_deb822_repo "45drives" \
|
||||
"https://repo.45drives.com/key/gpg.asc" \
|
||||
|
||||
+1
-2
@@ -38,8 +38,7 @@ function update_script() {
|
||||
echo -e "${INFO}${YW}This is a one-time migration. After this, you can update ${APP} anytime with:${CL}"
|
||||
echo -e "${TAB}${TAB}${GN}update_dockge${CL} or ${GN}bash <(curl -fsSL ${ADDON_SCRIPT})${CL}"
|
||||
echo ""
|
||||
read -r -p "${TAB}Migrate update function now? [y/N]: " CONFIRM
|
||||
if [[ ! "${CONFIRM,,}" =~ ^(y|yes)$ ]]; then
|
||||
if ! prompt_confirm "${TAB}Migrate update function now?" "n"; then
|
||||
msg_warn "Migration skipped. The old update will continue to work for now."
|
||||
msg_info "Updating ${APP} (legacy)"
|
||||
cd /opt/dockge
|
||||
|
||||
+1
-2
@@ -38,8 +38,7 @@ function update_script() {
|
||||
echo -e "${INFO}${YW}This is a one-time migration. After this, you can update ${APP} anytime with:${CL}"
|
||||
echo -e "${TAB}${TAB}${GN}update_dokploy${CL} or ${GN}bash <(curl -fsSL ${ADDON_SCRIPT})${CL}"
|
||||
echo ""
|
||||
read -r -p "${TAB}Migrate update function now? [y/N]: " CONFIRM
|
||||
if [[ ! "${CONFIRM,,}" =~ ^(y|yes)$ ]]; then
|
||||
if ! prompt_confirm "${TAB}Migrate update function now?" "n"; then
|
||||
msg_warn "Migration skipped. The old update will continue to work for now."
|
||||
msg_info "Updating ${APP} (legacy)"
|
||||
curl -sSL https://dokploy.com/install.sh | $STD bash -s update
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ function update_script() {
|
||||
|
||||
APP_VERSION=$(grep -o '"version": *"[^"]*"' /opt/gitea-mirror/package.json | cut -d'"' -f4)
|
||||
if [[ $APP_VERSION =~ ^2\. ]]; then
|
||||
if [[ "${PHS_SILENT:-0}" == "1" ]]; then
|
||||
if is_unattended; then
|
||||
msg_warn "Version $APP_VERSION detected. Major version upgrade requires interactive confirmation, skipping."
|
||||
exit 75
|
||||
fi
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ function update_script() {
|
||||
echo "Seerr is the new unified Jellyseerr and Overseerr."
|
||||
echo "More info: https://docs.seerr.dev/blog/seerr-release"
|
||||
echo
|
||||
if [[ "${PHS_SILENT:-0}" == "1" ]]; then
|
||||
if is_unattended; then
|
||||
msg_warn "Seerr migration detected - skipping update, requires an interactive run"
|
||||
exit 75
|
||||
fi
|
||||
|
||||
+1
-2
@@ -38,8 +38,7 @@ function update_script() {
|
||||
msg_custom "ℹ️" "${YW}" "This is a one-time migration. After this, you can update ${APP} anytime with:"
|
||||
echo -e "${TAB}${TAB}${GN}update_komodo${CL} or ${GN}bash <(curl -fsSL ${ADDON_SCRIPT})${CL}"
|
||||
echo ""
|
||||
read -r -p "${TAB}Migrate update function now? [y/N]: " CONFIRM
|
||||
if [[ ! "${CONFIRM,,}" =~ ^(y|yes)$ ]]; then
|
||||
if ! prompt_confirm "${TAB}Migrate update function now?" "n"; then
|
||||
msg_warn "Migration skipped. The old update will continue to work for now."
|
||||
msg_warn "⚠️ Komodo v2 uses :2 image tags. The :latest tag is deprecated and will not receive v2 updates."
|
||||
msg_warn "Please migrate to the addon script to receive Komodo v2."
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ function update_script() {
|
||||
echo "Seerr is the new unified Jellyseerr and Overseerr."
|
||||
echo "More info: https://docs.seerr.dev/blog/seerr-release"
|
||||
echo
|
||||
if [[ "${PHS_SILENT:-0}" == "1" ]]; then
|
||||
if is_unattended; then
|
||||
msg_warn "Seerr migration detected - skipping update, requires an interactive run"
|
||||
exit 75
|
||||
fi
|
||||
|
||||
+2
-2
@@ -63,7 +63,7 @@ function update_script() {
|
||||
echo -e "${GATEWAY}${BGN}https://docs.paperless-ngx.com/migration-v3/#encryption-support${CL}"
|
||||
msg_warn "Before continuing make sure that you do not use encryption or have decrypted all documents."
|
||||
echo ""
|
||||
if [[ "${PHS_SILENT:-0}" == "1" ]]; then
|
||||
if is_unattended; then
|
||||
msg_warn "Paperless-ngx v3 migration detected - skipping update, requires an interactive run"
|
||||
exit 75
|
||||
fi
|
||||
@@ -75,7 +75,7 @@ function update_script() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${PHS_SILENT:-0}" == "1" ]] && ! grep -q "uv run" /etc/systemd/system/paperless-webserver.service; then
|
||||
if is_unattended && ! grep -q "uv run" /etc/systemd/system/paperless-webserver.service; then
|
||||
msg_warn "Paperless-ngx uv migration detected - skipping update, requires an interactive run"
|
||||
exit 75
|
||||
fi
|
||||
|
||||
+1
-2
@@ -38,8 +38,7 @@ function update_script() {
|
||||
echo -e "${INFO}${YW}This is a one-time migration. After this, you can update ${APP} anytime with:${CL}"
|
||||
echo -e "${TAB}${TAB}${GN}update_runtipi${CL} or ${GN}bash <(curl -fsSL ${ADDON_SCRIPT})${CL}"
|
||||
echo ""
|
||||
read -r -p "${TAB}Migrate update function now? [y/N]: " CONFIRM
|
||||
if [[ ! "${CONFIRM,,}" =~ ^(y|yes)$ ]]; then
|
||||
if ! prompt_confirm "${TAB}Migrate update function now?" "n"; then
|
||||
msg_warn "Migration skipped. The old update will continue to work for now."
|
||||
msg_info "Updating ${APP} (legacy)"
|
||||
cd /opt/runtipi && ./runtipi-cli update latest
|
||||
|
||||
@@ -38,6 +38,10 @@ function update_script() {
|
||||
msg_warn "WARNING: Due to bugs with BoltDB database, update script will move your application"
|
||||
msg_warn "to use SQLite database instead. Make sure you have a backup of your data!"
|
||||
echo ""
|
||||
if is_unattended; then
|
||||
msg_warn "BoltDB to SQLite migration detected - skipping update, requires an interactive run"
|
||||
exit 75
|
||||
fi
|
||||
read -r -p "${TAB3}Do you want to continue? (y/N): " CONFIRM
|
||||
if [[ ! "$CONFIRM" =~ ^[Yy]$ ]]; then
|
||||
exit 0
|
||||
|
||||
+2
-2
@@ -224,8 +224,8 @@ EOF
|
||||
msg_custom "💾" "Your current config will be backed up to nginx.conf.bak"
|
||||
msg_custom "⚠️ " "Note: Custom modifications (reverse proxy, SSL) will be overwritten!"
|
||||
echo ""
|
||||
read -rp "${TAB3}Update Nginx configuration? [Y/n]: " REPLY
|
||||
if [[ "${REPLY,,}" =~ ^(y|yes|)$ ]]; then
|
||||
# Unattended keeps the current file: the new one drops reverse-proxy and SSL edits.
|
||||
if ! is_unattended && prompt_confirm "${TAB3}Update Nginx configuration?" "y"; then
|
||||
msg_info "Updating Nginx Configuration"
|
||||
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
|
||||
curl -fsSL "https://raw.githubusercontent.com/Termix-SSH/Termix/main/docker/nginx.conf" -o /etc/nginx/nginx.conf
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@ function update_script() {
|
||||
msg_warn "This requires MANUAL config changes in /etc/vikunja/config.yml."
|
||||
msg_warn "See: https://vikunja.io/changelog/whats-new-in-vikunja-1.0.0/#config-changes"
|
||||
|
||||
if [[ "${PHS_SILENT:-0}" == "1" ]]; then
|
||||
if is_unattended; then
|
||||
msg_warn "Vikunja 1.0 config migration detected - skipping update, requires an interactive run"
|
||||
exit 75
|
||||
fi
|
||||
@@ -64,7 +64,7 @@ function update_script() {
|
||||
echo -e "${TAB}${YW}How do you want to handle /etc/vikunja/config.yml?${CL}"
|
||||
echo -e "${TAB} 1) Keep your current config"
|
||||
echo -e "${TAB} 2) Install the new package maintainer's config"
|
||||
if [[ "${PHS_SILENT:-0}" == "1" ]]; then
|
||||
if is_unattended; then
|
||||
CONFIG_CHOICE="1"
|
||||
else
|
||||
read -rp " Choose [1/2] (default: 1): " -t 60 CONFIG_CHOICE || CONFIG_CHOICE="1"
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ function update_script() {
|
||||
ZABBIX_SERIES="$(dpkg-query -W -f='${Version}' zabbix-release 2>/dev/null || true)"
|
||||
ZABBIX_SERIES="${ZABBIX_SERIES#*:}"
|
||||
ZABBIX_SERIES="${ZABBIX_SERIES%%[!0-9.]*}"
|
||||
if [[ "${PHS_SILENT:-0}" == "1" ]]; then
|
||||
if is_unattended; then
|
||||
if [[ ! "$ZABBIX_SERIES" =~ ^[0-9]+\.[0-9]+$ ]]; then
|
||||
msg_warn "Could not detect the installed Zabbix series - skipping update, requires an interactive run"
|
||||
exit 75
|
||||
|
||||
Reference in new issue
Block a user