Compare commits

...

15 Commits

Author SHA1 Message Date
CanbiZ (MickLesk)
2d6ff0da99 Frigate: Bump to v0.17 2026-03-02 13:24:32 +01:00
community-scripts-pr-app[bot]
ab1e1cc66e chore: update github-versions.json (#12473)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-02 12:12:31 +00:00
community-scripts-pr-app[bot]
256143af42 Update CHANGELOG.md (#12471)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-02 09:56:01 +00:00
CanbiZ (MickLesk)
5dc244a8c1 core: standardize exit codes and add mappings (#12467)
* Standardize exit codes and add mappings

Replace generic exit 1 usages with specific numeric exit codes and add corresponding explanations to the error lookup. This commit updates multiple misc/* scripts to return distinct codes for validation, Proxmox/LXC, networking, download and curl errors (e.g. 103-123, 64, 107-120, 206, 0 for explicit user cancels). It also updates curl error handling to propagate the original curl exit code and adds new entries in explain_exit_code and the error handler to improve diagnostics.

* Set exit code 115 for update_os errors

Change exit status from 6 to 115 in misc/alpine-install.func's update_os() error handlers when failing to download tools.func or when the expected functions are missing. This gives a distinct exit code for these specific failure cases.

* Add tools/addon exit codes and use them

Introduce exit codes 232-238 for Tools & Addon scripts in misc/api.func and misc/error_handler.func. Update addon scripts (tools/addon/adguardhome-sync.sh, tools/addon/copyparty.sh, tools/addon/cronmaster.sh) to return specific codes instead of generic exit 1: 238 for unsupported OS and 233 when the application is not installed/upgrade prerequisites are missing. This makes failures more descriptive and aligns scripts with the central error explanations.

* Standardize exit codes in exporter addons

Unify exit codes across exporter addon scripts: return 238 for unsupported OS detections and 233 when an update is requested but the exporter is not installed. Applied to nextcloud-exporter.sh, pihole-exporter.sh, prometheus-paperless-ngx-exporter.sh, and qbittorrent-exporter.sh to make failure modes distinguishable for callers/automation.

* Use specific exit codes in addon scripts

Replace generic exit 1 with distinct exit codes across multiple addon scripts to enable finer-grained error handling in automation. Exit codes introduced: 10 for Docker/Compose missing or user-declined Docker install, 233 for "nothing to update" cases, and 238 for unsupported OS cases. Affected files: tools/addon/arcane.sh, coolify.sh, dockge.sh, dokploy.sh, filebrowser-quantum.sh, filebrowser.sh, immich-public-proxy.sh, jellystat.sh, runtipi.sh.

* Use specific exit codes in addon scripts

Replace generic exit 1 with specific exit codes across multiple addon scripts to improve error signaling and handling. Files updated: tools/addon/add-netbird-lxc.sh (exit 238 on unsupported distro), tools/addon/add-tailscale-lxc.sh (treat user cancel as exit 0), tools/addon/glances.sh (exit 233 when not installed), tools/addon/komodo.sh (distinct exits for missing compose, legacy DB, backup/download failures, docker checks), tools/addon/netdata.sh (distinct exits for unsupported PVE versions, OS/codename detection, repo lookups), and tools/addon/phpmyadmin.sh (distinct exits for unsupported OS, network/download issues, package install/start failures, and invalid input). These changes make failures easier to identify and automate recovery or reporting.

* Use specific exit codes in PVE scripts

Replace generic exit 1 with distinct exit codes across tools/pve scripts to provide clearer failure signals for callers. post-pve-install.sh now returns 105 for unsupported Proxmox versions; pve-privilege-converter.sh uses 104 for non-root, 234 when no containers, and 235 for backup/conversion failures; update-apps.sh maps backup failures to 235, missing containers/selections to 234 (and UI cancellations to 0), missing backup storage to 119, and returns the actual container update exit code on failure. These changes improve diagnostics and allow external tooling to react to specific error conditions.

* Standardize exit codes and behaviors

Adjust exit codes and abort handling across multiple PVE helper scripts to provide clearer outcomes for automation and interactive flows. Changes include:

- container-restore-from-backup.sh, core-restore-from-backup.sh: return 235 when no backups found (was 1).
- fstrim.sh: treat user cancellation of non-ext4 warning as non-error (exit 0 instead of 1).
- kernel-clean.sh: treat no selection or user abort as non-error (exit 0 instead of 1).
- lxc-delete.sh: return 234 when no containers are present; treat no selection as non-error (exit 0).
- nic-offloading-fix.sh: use specific non-zero codes for root check and tool install failures (exit 104, 237) and 236 when no matching interfaces (was 1).
- pbs_microcode.sh, post-pmg-install.sh, post-pbs-install.sh: use distinct exit codes (232 and 105) for detected VM/PVE/unsupported distro conditions instead of generic 1.

These modifications make scripts return distinct codes for different failure modes and ensure user-initiated aborts or benign conditions exit with 0 where appropriate.

* Use exit 105 for unsupported PVE versions

Standardize error handling by replacing generic exit 1 with exit 105 in pve_check() across multiple VM template scripts to indicate unsupported Proxmox VE versions. Also add API exit code 226 message for "Proxmox: VM disk import or post-creation setup failed" in misc/api.func. Affected files include misc/api.func and various vm/*-vm.sh scripts.

* Use specific exit codes in VM scripts

Replace generic exit 1 with distinct exit codes across vm/*.sh to make failures more actionable for callers. Changes include: use 226 for missing imported-disk references, 237 for pv installation failures, 115 for download/extract/ISO-related failures, 214 for insufficient disk space during FreeBSD decompression, and 119 for missing storage detection. Updated scripts: archlinux-vm.sh, docker-vm.sh, haos-vm.sh, openwrt-vm.sh, opnsense-vm.sh, truenas-vm.sh, umbrel-os-vm.sh.
2026-03-02 10:55:20 +01:00
CanbiZ (MickLesk)
9f15ca6242 Simplify lxc-attach logging and terminal handling
Remove host-side tee capture of lxc-attach output and PIPESTATUS handling; lxc-attach is now invoked directly and the exit code is taken from $?. Simplify install log retrieval by pulling /root/.install-<SESSION_ID>.log directly and removing the fallback that used the host-captured terminal log, related temp-file size checks, and timeout logic. Remove terminal-state restores and input-draining (stty/dd) and stop redirecting reads from /dev/tty so interactive reads use standard input; similar simplifications applied to the retry flow. Also remove cleanup of the discarded capture log. These changes reduce complexity and terminal manipulation, at the cost of losing the previous terminal-capture fallback for installs that failed to produce a container-side log.
2026-03-02 10:46:25 +01:00
CanbiZ (MickLesk)
750b904abc Flush terminal input and make repo cache global
Restore and sanitize terminal state before prompting by draining stale input from /dev/tty (dd iflag=nonblock) and adding a short sleep, then perform timed reads from /dev/tty in misc/build.func and misc/error_handler.func. Also make _REPO_CACHE a global associative array (declare -gA) with fallbacks in misc/tools.func so the cache survives when tools.func is sourced inside a function scope.
2026-03-02 10:40:17 +01:00
CanbiZ (MickLesk)
96b5411d1d Use PG_VERSION var; default to vendor repos
Pass PG_VERSION from the Mealie installer (replace POSTGRES_VERSION with PG_VERSION) and update misc/tools.func to prefer vendor package repos by default. Adjusted comments/examples for setup_mysql and setup_postgresql to reflect the new default behavior, and changed the local default for USE_MYSQL_REPO to true. These changes align variable naming in the installer and clarify that official MySQL/PGDG repositories are used unless explicitly disabled.
2026-03-02 10:35:30 +01:00
CanbiZ (MickLesk)
a3404102ce Update tools.func 2026-03-02 10:29:04 +01:00
CanbiZ (MickLesk)
374c4492d9 Read prompts from a fresh /dev/tty to avoid tty corruption
Replace pre-opened _RECOVERY_TTY handling with direct reads from /dev/tty in misc/build.func and misc/error_handler.func. The change opens /dev/tty at prompt time (with stty sane) so the prompt reads aren't affected by tty state corruption from lxc-attach|tee, simplifies the read logic by using a local response variable with a timeout, and removes the pre-open/close bookkeeping for _RECOVERY_TTY.
2026-03-02 10:25:19 +01:00
CanbiZ (MickLesk)
3cfe86512d Fix read failures in install scripts and recovery menu
Two critical bugs fixed:

1. Install scripts (80+) using 'read' for interactive prompts all fail because
   lxc-attach stdin was redirected from /dev/null. Change to /dev/tty so install
   scripts like immich, elementsynapse, etc. can prompt the user interactively.

2. Recovery menu read gets 'Input/output error' from /dev/tty after the
   lxc-attach|tee pipeline corrupts the terminal state. Pre-open a separate
   file descriptor to /dev/tty BEFORE the pipeline starts. This fd survives
   any tty corruption and is used as fallback for the recovery menu read.
   Fixes the 'command not found' issue where user input falls through to the
   parent shell.

Both build.func (main install + APT retry) and error_handler.func (fallback
cleanup prompt) are updated with the same pattern.
2026-03-02 10:05:55 +01:00
community-scripts-pr-app[bot]
47e3e415b9 Update .app files (#12464)
Co-authored-by: GitHub Actions <github-actions[bot]@users.noreply.github.com>
2026-03-02 09:41:21 +01:00
community-scripts-pr-app[bot]
3373533725 Update CHANGELOG.md (#12466)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-02 08:36:59 +00:00
community-scripts-pr-app[bot]
62c7c329d7 Update CHANGELOG.md (#12465)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-02 08:36:43 +00:00
community-scripts-pr-app[bot]
da04899558 Update date in json (#12463)
Co-authored-by: GitHub Actions <github-actions[bot]@users.noreply.github.com>
2026-03-02 08:36:34 +00:00
push-app-to-main[bot]
e49f09b5ec Profilarr (#12441) 2026-03-02 09:36:16 +01:00
66 changed files with 573 additions and 291 deletions

View File

@@ -412,6 +412,10 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
## 2026-03-02 ## 2026-03-02
### 🆕 New Scripts
- Profilarr ([#12441](https://github.com/community-scripts/ProxmoxVE/pull/12441))
### 🚀 Updated Scripts ### 🚀 Updated Scripts
- #### 💥 Breaking Changes - #### 💥 Breaking Changes
@@ -424,6 +428,10 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- tools.func: Improve stability with retry logic, caching, and debug mode [@MickLesk](https://github.com/MickLesk) ([#10351](https://github.com/community-scripts/ProxmoxVE/pull/10351)) - tools.func: Improve stability with retry logic, caching, and debug mode [@MickLesk](https://github.com/MickLesk) ([#10351](https://github.com/community-scripts/ProxmoxVE/pull/10351))
- #### 🔧 Refactor
- core: standardize exit codes and add mappings [@MickLesk](https://github.com/MickLesk) ([#12467](https://github.com/community-scripts/ProxmoxVE/pull/12467))
### 🌐 Website ### 🌐 Website
- frontend: improve detail view badges, addon texts, and HTML title [@MickLesk](https://github.com/MickLesk) ([#12461](https://github.com/community-scripts/ProxmoxVE/pull/12461)) - frontend: improve detail view badges, addon texts, and HTML title [@MickLesk](https://github.com/MickLesk) ([#12461](https://github.com/community-scripts/ProxmoxVE/pull/12461))

6
ct/headers/profilarr Normal file
View File

@@ -0,0 +1,6 @@
____ _____ __
/ __ \_________ / __(_) /___ ___________
/ /_/ / ___/ __ \/ /_/ / / __ `/ ___/ ___/
/ ____/ / / /_/ / __/ / / /_/ / / / /
/_/ /_/ \____/_/ /_/_/\__,_/_/ /_/

85
ct/profilarr.sh Normal file
View File

@@ -0,0 +1,85 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: michelroegl-brunner
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Dictionarry-Hub/profilarr
APP="Profilarr"
var_tags="${var_tags:-arr;radarr;sonarr;config}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/profilarr ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "profilarr" "Dictionarry-Hub/profilarr"; then
msg_info "Stopping Service"
systemctl stop profilarr
msg_ok "Stopped Service"
msg_info "Backing up Data"
if [[ -d /config ]]; then
cp -r /config /opt/profilarr_config_backup
fi
msg_ok "Backed up Data"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "profilarr" "Dictionarry-Hub/profilarr" "tarball"
msg_info "Installing Python Dependencies"
cd /opt/profilarr/backend
$STD uv venv /opt/profilarr/backend/.venv
sed 's/==/>=/g' requirements.txt >requirements-relaxed.txt
$STD uv pip install --python /opt/profilarr/backend/.venv/bin/python -r requirements-relaxed.txt
rm -f requirements-relaxed.txt
msg_ok "Installed Python Dependencies"
msg_info "Building Frontend"
if [[ -d /opt/profilarr/frontend ]]; then
cd /opt/profilarr/frontend
$STD npm install
$STD npm run build
cp -r dist /opt/profilarr/backend/app/static
fi
msg_ok "Built Frontend"
msg_info "Restoring Data"
if [[ -d /opt/profilarr_config_backup ]]; then
mkdir -p /config
cp -r /opt/profilarr_config_backup/. /config/
rm -rf /opt/profilarr_config_backup
fi
msg_ok "Restored Data"
msg_info "Starting Service"
systemctl start profilarr
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:6868${CL}"

View File

@@ -1,5 +1,5 @@
{ {
"generated": "2026-03-02T06:20:15Z", "generated": "2026-03-02T12:12:21Z",
"versions": [ "versions": [
{ {
"slug": "2fauth", "slug": "2fauth",
@@ -312,9 +312,9 @@
{ {
"slug": "domain-monitor", "slug": "domain-monitor",
"repo": "Hosteroid/domain-monitor", "repo": "Hosteroid/domain-monitor",
"version": "v1.1.3", "version": "v1.1.4",
"pinned": false, "pinned": false,
"date": "2026-02-11T15:48:18Z" "date": "2026-03-02T09:25:01Z"
}, },
{ {
"slug": "donetick", "slug": "donetick",
@@ -452,9 +452,9 @@
{ {
"slug": "gitea-mirror", "slug": "gitea-mirror",
"repo": "RayLabsHQ/gitea-mirror", "repo": "RayLabsHQ/gitea-mirror",
"version": "v3.10.1", "version": "v3.11.0",
"pinned": false, "pinned": false,
"date": "2026-03-01T03:08:07Z" "date": "2026-03-02T10:19:59Z"
}, },
{ {
"slug": "glance", "slug": "glance",
@@ -634,9 +634,9 @@
{ {
"slug": "jotty", "slug": "jotty",
"repo": "fccview/jotty", "repo": "fccview/jotty",
"version": "1.20.0", "version": "1.21.0",
"pinned": false, "pinned": false,
"date": "2026-02-12T09:23:30Z" "date": "2026-03-02T11:08:54Z"
}, },
{ {
"slug": "kapowarr", "slug": "kapowarr",
@@ -1156,6 +1156,13 @@
"pinned": false, "pinned": false,
"date": "2025-11-12T07:10:14Z" "date": "2025-11-12T07:10:14Z"
}, },
{
"slug": "profilarr",
"repo": "Dictionarry-Hub/profilarr",
"version": "v1.1.4",
"pinned": false,
"date": "2026-01-29T14:57:25Z"
},
{ {
"slug": "projectsend", "slug": "projectsend",
"repo": "projectsend/projectsend", "repo": "projectsend/projectsend",
@@ -1418,9 +1425,9 @@
{ {
"slug": "snowshare", "slug": "snowshare",
"repo": "TuroYT/snowshare", "repo": "TuroYT/snowshare",
"version": "v1.3.7", "version": "v1.3.8",
"pinned": false, "pinned": false,
"date": "2026-02-23T15:51:39Z" "date": "2026-03-02T07:43:42Z"
}, },
{ {
"slug": "sonarr", "slug": "sonarr",
@@ -1656,9 +1663,9 @@
{ {
"slug": "victoriametrics", "slug": "victoriametrics",
"repo": "VictoriaMetrics/VictoriaMetrics", "repo": "VictoriaMetrics/VictoriaMetrics",
"version": "v1.136.0", "version": "v1.137.0",
"pinned": false, "pinned": false,
"date": "2026-02-16T13:17:50Z" "date": "2026-03-02T10:09:29Z"
}, },
{ {
"slug": "vikunja", "slug": "vikunja",
@@ -1684,9 +1691,9 @@
{ {
"slug": "wanderer", "slug": "wanderer",
"repo": "meilisearch/meilisearch", "repo": "meilisearch/meilisearch",
"version": "v1.36.0", "version": "v1.37.0",
"pinned": false, "pinned": false,
"date": "2026-02-23T08:13:32Z" "date": "2026-03-02T09:16:36Z"
}, },
{ {
"slug": "warracker", "slug": "warracker",
@@ -1789,9 +1796,9 @@
{ {
"slug": "zigbee2mqtt", "slug": "zigbee2mqtt",
"repo": "Koenkk/zigbee2mqtt", "repo": "Koenkk/zigbee2mqtt",
"version": "2.9.0", "version": "2.9.1",
"pinned": false, "pinned": false,
"date": "2026-03-01T13:58:14Z" "date": "2026-03-02T11:16:46Z"
}, },
{ {
"slug": "zipline", "slug": "zipline",
@@ -1803,9 +1810,9 @@
{ {
"slug": "zitadel", "slug": "zitadel",
"repo": "zitadel/zitadel", "repo": "zitadel/zitadel",
"version": "v4.11.1", "version": "v4.12.0",
"pinned": false, "pinned": false,
"date": "2026-02-25T06:13:13Z" "date": "2026-03-02T08:16:10Z"
}, },
{ {
"slug": "zoraxy", "slug": "zoraxy",

View File

@@ -0,0 +1,35 @@
{
"name": "Profilarr",
"slug": "profilarr",
"categories": [
14
],
"date_created": "2026-03-02",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 6868,
"documentation": "https://github.com/Dictionarry-Hub/profilarr#readme",
"website": "https://github.com/Dictionarry-Hub/profilarr",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/profilarr.webp",
"config_path": "/config",
"description": "Profilarr is a configuration management platform for Radarr and Sonarr that simplifies importing, syncing, and managing quality profiles, custom formats, and release profiles.",
"install_methods": [
{
"type": "default",
"script": "ct/profilarr.sh",
"resources": {
"cpu": 2,
"ram": 2048,
"hdd": 8,
"os": "Debian",
"version": "13"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": []
}

View File

@@ -1,8 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG # Copyright (c) 2021-2026 community-scripts ORG
# Authors: MickLesk (CanbiZ) # Authors: MickLesk (CanbiZ) | Co-Authors: remz1337
# Co-Authors: remz1337
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://frigate.video/ | Github: https://github.com/blakeblackshear/frigate # Source: https://frigate.video/ | Github: https://github.com/blakeblackshear/frigate
@@ -85,6 +84,7 @@ $STD apt install -y \
tclsh \ tclsh \
libopenblas-dev \ libopenblas-dev \
liblapack-dev \ liblapack-dev \
libgomp1 \
make \ make \
moreutils moreutils
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
@@ -101,9 +101,16 @@ export NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
export TOKENIZERS_PARALLELISM=true export TOKENIZERS_PARALLELISM=true
export TRANSFORMERS_NO_ADVISORY_WARNINGS=1 export TRANSFORMERS_NO_ADVISORY_WARNINGS=1
export OPENCV_FFMPEG_LOGLEVEL=8 export OPENCV_FFMPEG_LOGLEVEL=8
export PYTHONWARNINGS="ignore:::numpy.core.getlimits"
export HAILORT_LOGGER_PATH=NONE export HAILORT_LOGGER_PATH=NONE
export TF_CPP_MIN_LOG_LEVEL=3
export TF_CPP_MIN_VLOG_LEVEL=3
export TF_ENABLE_ONEDNN_OPTS=0
export AUTOGRAPH_VERBOSITY=0
export GLOG_minloglevel=3
export GLOG_logtostderr=0
fetch_and_deploy_gh_release "frigate" "blakeblackshear/frigate" "tarball" "v0.16.4" "/opt/frigate" fetch_and_deploy_gh_release "frigate" "blakeblackshear/frigate" "tarball" "v0.17.0" "/opt/frigate"
msg_info "Building Nginx" msg_info "Building Nginx"
$STD bash /opt/frigate/docker/main/build_nginx.sh $STD bash /opt/frigate/docker/main/build_nginx.sh
@@ -138,13 +145,19 @@ install -c -m 644 libusb-1.0.pc /usr/local/lib/pkgconfig
ldconfig ldconfig
msg_ok "Built libUSB" msg_ok "Built libUSB"
msg_info "Bootstrapping pip"
wget -q https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
sed -i 's/args.append("setuptools")/args.append("setuptools==77.0.3")/' /tmp/get-pip.py
$STD python3 /tmp/get-pip.py "pip"
rm -f /tmp/get-pip.py
msg_ok "Bootstrapped pip"
msg_info "Installing Python Dependencies" msg_info "Installing Python Dependencies"
$STD pip3 install -r /opt/frigate/docker/main/requirements.txt $STD pip3 install -r /opt/frigate/docker/main/requirements.txt
msg_ok "Installed Python Dependencies" msg_ok "Installed Python Dependencies"
msg_info "Building Python Wheels (Patience)" msg_info "Building Python Wheels (Patience)"
mkdir -p /wheels mkdir -p /wheels
sed -i 's|^SQLITE3_VERSION=.*|SQLITE3_VERSION="version-3.46.0"|g' /opt/frigate/docker/main/build_pysqlite3.sh
$STD bash /opt/frigate/docker/main/build_pysqlite3.sh $STD bash /opt/frigate/docker/main/build_pysqlite3.sh
for i in {1..3}; do for i in {1..3}; do
$STD pip3 wheel --wheel-dir=/wheels -r /opt/frigate/docker/main/requirements-wheels.txt --default-timeout=300 --retries=3 && break $STD pip3 wheel --wheel-dir=/wheels -r /opt/frigate/docker/main/requirements-wheels.txt --default-timeout=300 --retries=3 && break
@@ -152,7 +165,7 @@ for i in {1..3}; do
done done
msg_ok "Built Python Wheels" msg_ok "Built Python Wheels"
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs NODE_VERSION="20" setup_nodejs
msg_info "Downloading Inference Models" msg_info "Downloading Inference Models"
mkdir -p /models /openvino-model mkdir -p /models /openvino-model
@@ -183,6 +196,10 @@ $STD pip3 install -U /wheels/*.whl
ldconfig ldconfig
msg_ok "Installed HailoRT Runtime" msg_ok "Installed HailoRT Runtime"
msg_info "Installing MemryX Runtime"
$STD bash /opt/frigate/docker/main/install_memryx.sh
msg_ok "Installed MemryX Runtime"
msg_info "Installing OpenVino" msg_info "Installing OpenVino"
$STD pip3 install -r /opt/frigate/docker/main/requirements-ov.txt $STD pip3 install -r /opt/frigate/docker/main/requirements-ov.txt
msg_ok "Installed OpenVino" msg_ok "Installed OpenVino"
@@ -209,6 +226,8 @@ $STD make version
cd /opt/frigate/web cd /opt/frigate/web
$STD npm install $STD npm install
$STD npm run build $STD npm run build
mv /opt/frigate/web/dist/BASE_PATH/monacoeditorwork/* /opt/frigate/web/dist/assets/
rm -rf /opt/frigate/web/dist/BASE_PATH
cp -r /opt/frigate/web/dist/* /opt/frigate/web/ cp -r /opt/frigate/web/dist/* /opt/frigate/web/
sed -i '/^s6-svc -O \.$/s/^/#/' /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run sed -i '/^s6-svc -O \.$/s/^/#/' /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run
msg_ok "Built Frigate Application" msg_ok "Built Frigate Application"
@@ -224,6 +243,19 @@ echo "tmpfs /tmp/cache tmpfs defaults 0 0" >>/etc/fstab
cat <<EOF >/etc/frigate.env cat <<EOF >/etc/frigate.env
DEFAULT_FFMPEG_VERSION="7.0" DEFAULT_FFMPEG_VERSION="7.0"
INCLUDED_FFMPEG_VERSIONS="7.0:5.0" INCLUDED_FFMPEG_VERSIONS="7.0:5.0"
NVIDIA_VISIBLE_DEVICES=all
NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
TOKENIZERS_PARALLELISM=true
TRANSFORMERS_NO_ADVISORY_WARNINGS=1
OPENCV_FFMPEG_LOGLEVEL=8
PYTHONWARNINGS="ignore:::numpy.core.getlimits"
HAILORT_LOGGER_PATH=NONE
TF_CPP_MIN_LOG_LEVEL=3
TF_CPP_MIN_VLOG_LEVEL=3
TF_ENABLE_ONEDNN_OPTS=0
AUTOGRAPH_VERBOSITY=0
GLOG_minloglevel=3
GLOG_logtostderr=0
EOF EOF
cat <<EOF >/config/config.yml cat <<EOF >/config/config.yml
@@ -237,7 +269,6 @@ cameras:
input_args: -re -stream_loop -1 -fflags +genpts input_args: -re -stream_loop -1 -fflags +genpts
roles: roles:
- detect - detect
- rtmp
detect: detect:
height: 1080 height: 1080
width: 1920 width: 1920
@@ -255,6 +286,7 @@ ffmpeg:
detectors: detectors:
detector01: detector01:
type: openvino type: openvino
device: AUTO
model: model:
width: 300 width: 300
height: 300 height: 300

View File

@@ -28,7 +28,7 @@ $STD apt install -y \
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
PYTHON_VERSION="3.12" setup_uv PYTHON_VERSION="3.12" setup_uv
POSTGRES_VERSION="16" setup_postgresql PG_VERSION="16" setup_postgresql
NODE_MODULE="yarn" NODE_VERSION="24" setup_nodejs NODE_MODULE="yarn" NODE_VERSION="24" setup_nodejs
fetch_and_deploy_gh_release "mealie" "mealie-recipes/mealie" "tarball" "latest" "/opt/mealie" fetch_and_deploy_gh_release "mealie" "mealie-recipes/mealie" "tarball" "latest" "/opt/mealie"
PG_DB_NAME="mealie_db" PG_DB_USER="mealie_user" PG_DB_GRANT_SUPERUSER="true" setup_postgresql_db PG_DB_NAME="mealie_db" PG_DB_USER="mealie_user" PG_DB_GRANT_SUPERUSER="true" setup_postgresql_db

View File

@@ -0,0 +1,74 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: michelroegl-brunner
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Dictionarry-Hub/profilarr
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
build-essential \
python3-dev \
libffi-dev \
libssl-dev \
git
msg_ok "Installed Dependencies"
PYTHON_VERSION="3.12" setup_uv
NODE_VERSION="22" setup_nodejs
msg_info "Creating directories"
mkdir -p /opt/profilarr \
/config
msg_ok "Created directories"
fetch_and_deploy_gh_release "profilarr" "Dictionarry-Hub/profilarr" "tarball"
msg_info "Installing Python Dependencies"
cd /opt/profilarr/backend
$STD uv venv /opt/profilarr/backend/.venv
sed 's/==/>=/g' requirements.txt >requirements-relaxed.txt
$STD uv pip install --python /opt/profilarr/backend/.venv/bin/python -r requirements-relaxed.txt
rm -f requirements-relaxed.txt
msg_ok "Installed Python Dependencies"
msg_info "Building Frontend"
cd /opt/profilarr/frontend
$STD npm install
$STD npm run build
cp -r dist /opt/profilarr/backend/app/static
msg_ok "Built Frontend"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/profilarr.service
[Unit]
Description=Profilarr - Configuration Management Platform for Radarr/Sonarr
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/profilarr/backend
Environment="PATH=/opt/profilarr/backend/.venv/bin:/usr/local/bin:/usr/bin:/bin"
Environment="PYTHONPATH=/opt/profilarr/backend"
ExecStart=/opt/profilarr/backend/.venv/bin/gunicorn --bind 0.0.0.0:6868 --timeout 600 app.main:create_app()
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now profilarr
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc

View File

@@ -79,7 +79,7 @@ setting_up_container() {
if [ "$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d'/' -f1)" = "" ]; then if [ "$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d'/' -f1)" = "" ]; then
echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}" echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
echo -e "${NETWORK}Check Network Settings" echo -e "${NETWORK}Check Network Settings"
exit 1 exit 121
fi fi
msg_ok "Set up Container OS" msg_ok "Set up Container OS"
msg_ok "Network Connected: ${BL}$(ip addr show | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1 | tail -n1)${CL}" msg_ok "Network Connected: ${BL}$(ip addr show | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1 | tail -n1)${CL}"
@@ -99,7 +99,7 @@ network_check() {
echo -e "${INFO}${RD}Expect Issues Without Internet${CL}" echo -e "${INFO}${RD}Expect Issues Without Internet${CL}"
else else
echo -e "${NETWORK}Check Network Settings" echo -e "${NETWORK}Check Network Settings"
exit 1 exit 122
fi fi
fi fi
RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }') RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
@@ -119,12 +119,12 @@ update_os() {
local tools_content local tools_content
tools_content=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) || { tools_content=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) || {
msg_error "Failed to download tools.func" msg_error "Failed to download tools.func"
exit 6 exit 115
} }
source /dev/stdin <<<"$tools_content" source /dev/stdin <<<"$tools_content"
if ! declare -f fetch_and_deploy_gh_release >/dev/null 2>&1; then if ! declare -f fetch_and_deploy_gh_release >/dev/null 2>&1; then
msg_error "tools.func loaded but incomplete — missing expected functions" msg_error "tools.func loaded but incomplete — missing expected functions"
exit 6 exit 115
fi fi
msg_ok "Updated Container OS" msg_ok "Updated Container OS"
post_progress_to_api post_progress_to_api

View File

@@ -124,6 +124,7 @@ detect_repo_source
# * Generic/Shell errors (1-3, 10, 124-132, 134, 137, 139, 141, 143-146) # * Generic/Shell errors (1-3, 10, 124-132, 134, 137, 139, 141, 143-146)
# * curl/wget errors (4-8, 16, 18, 22-28, 30, 32-36, 39, 44-48, 51-52, 55-57, 59, 61, 63, 75, 78-79, 92, 95) # * curl/wget errors (4-8, 16, 18, 22-28, 30, 32-36, 39, 44-48, 51-52, 55-57, 59, 61, 63, 75, 78-79, 92, 95)
# * Package manager errors (APT, DPKG: 100-102, 255) # * Package manager errors (APT, DPKG: 100-102, 255)
# * Script Validation & Setup (103-123)
# * BSD sysexits (64-78) # * BSD sysexits (64-78)
# * Systemd/Service errors (150-154) # * Systemd/Service errors (150-154)
# * Python/pip/uv errors (160-162) # * Python/pip/uv errors (160-162)
@@ -131,6 +132,7 @@ detect_repo_source
# * MySQL/MariaDB errors (180-183) # * MySQL/MariaDB errors (180-183)
# * MongoDB errors (190-193) # * MongoDB errors (190-193)
# * Proxmox custom codes (200-231) # * Proxmox custom codes (200-231)
# * Tools & Addon Scripts (232-238)
# * Node.js/npm errors (239, 243, 245-249) # * Node.js/npm errors (239, 243, 245-249)
# - Returns description string for given exit code # - Returns description string for given exit code
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -189,6 +191,29 @@ explain_exit_code() {
101) echo "APT: Configuration error (bad sources.list, malformed config)" ;; 101) echo "APT: Configuration error (bad sources.list, malformed config)" ;;
102) echo "APT: Lock held by another process (dpkg/apt still running)" ;; 102) echo "APT: Lock held by another process (dpkg/apt still running)" ;;
# --- Script Validation & Setup (103-123) ---
103) echo "Validation: Shell is not Bash" ;;
104) echo "Validation: Not running as root (or invoked via sudo)" ;;
105) echo "Validation: Proxmox VE version not supported" ;;
106) echo "Validation: Architecture not supported (ARM / PiMox)" ;;
107) echo "Validation: Kernel key parameters unreadable" ;;
108) echo "Validation: Kernel key limits exceeded" ;;
109) echo "Proxmox: No available container ID after max attempts" ;;
110) echo "Proxmox: Failed to apply default.vars" ;;
111) echo "Proxmox: App defaults file not available" ;;
112) echo "Proxmox: Invalid install menu option" ;;
113) echo "LXC: Under-provisioned — user aborted update" ;;
114) echo "LXC: Storage too low — user aborted update" ;;
115) echo "Download: install.func download failed or incomplete" ;;
116) echo "Proxmox: Default bridge vmbr0 not found" ;;
117) echo "LXC: Container did not reach running state" ;;
118) echo "LXC: No IP assigned to container after timeout" ;;
119) echo "Proxmox: No valid storage for rootdir content" ;;
120) echo "Proxmox: No valid storage for vztmpl content" ;;
121) echo "LXC: Container network not ready (no IP after retries)" ;;
122) echo "LXC: No internet connectivity — user declined to continue" ;;
123) echo "LXC: Local IP detection failed" ;;
# --- BSD sysexits.h (64-78) --- # --- BSD sysexits.h (64-78) ---
64) echo "Usage error (wrong arguments)" ;; 64) echo "Usage error (wrong arguments)" ;;
65) echo "Data format error (bad input data)" ;; 65) echo "Data format error (bad input data)" ;;
@@ -276,8 +301,18 @@ explain_exit_code() {
223) echo "Proxmox: Template not available after download" ;; 223) echo "Proxmox: Template not available after download" ;;
224) echo "Proxmox: PBS storage is for backups only" ;; 224) echo "Proxmox: PBS storage is for backups only" ;;
225) echo "Proxmox: No template available for OS/Version" ;; 225) echo "Proxmox: No template available for OS/Version" ;;
226) echo "Proxmox: VM disk import or post-creation setup failed" ;;
231) echo "Proxmox: LXC stack upgrade failed" ;; 231) echo "Proxmox: LXC stack upgrade failed" ;;
# --- Tools & Addon Scripts (232-238) ---
232) echo "Tools: Wrong execution environment (run on PVE host, not inside LXC)" ;;
233) echo "Tools: Application not installed (update prerequisite missing)" ;;
234) echo "Tools: No LXC containers found or available" ;;
235) echo "Tools: Backup or restore operation failed" ;;
236) echo "Tools: Required hardware not detected" ;;
237) echo "Tools: Dependency package installation failed" ;;
238) echo "Tools: OS or distribution not supported for this addon" ;;
# --- Node.js / npm / pnpm / yarn (239-249) --- # --- Node.js / npm / pnpm / yarn (239-249) ---
239) echo "npm/Node.js: Unexpected runtime error or dependency failure" ;; 239) echo "npm/Node.js: Unexpected runtime error or dependency failure" ;;
243) echo "Node.js: Out of memory (JavaScript heap out of memory)" ;; 243) echo "Node.js: Out of memory (JavaScript heap out of memory)" ;;

View File

@@ -119,7 +119,7 @@ maxkeys_check() {
# Exit if kernel parameters are unavailable # Exit if kernel parameters are unavailable
if [[ "$per_user_maxkeys" -eq 0 || "$per_user_maxbytes" -eq 0 ]]; then if [[ "$per_user_maxkeys" -eq 0 || "$per_user_maxbytes" -eq 0 ]]; then
msg_error "Unable to read kernel key parameters. Ensure proper permissions." msg_error "Unable to read kernel key parameters. Ensure proper permissions."
exit 1 exit 107
fi fi
# Fetch key usage for user ID 100000 (typical for containers) # Fetch key usage for user ID 100000 (typical for containers)
@@ -148,7 +148,7 @@ maxkeys_check() {
# Provide next steps if issues are detected # Provide next steps if issues are detected
if [[ "$failure" -eq 1 ]]; then if [[ "$failure" -eq 1 ]]; then
msg_error "Kernel key limits exceeded - see suggestions above" msg_error "Kernel key limits exceeded - see suggestions above"
exit 1 exit 108
fi fi
# Silent success - only show errors if they exist # Silent success - only show errors if they exist
@@ -355,7 +355,7 @@ get_valid_container_id() {
attempts=$((attempts + 1)) attempts=$((attempts + 1))
if [[ $attempts -ge $max_attempts ]]; then if [[ $attempts -ge $max_attempts ]]; then
msg_error "Could not find available container ID after $max_attempts attempts" msg_error "Could not find available container ID after $max_attempts attempts"
exit 1 exit 109
fi fi
done done
@@ -2035,7 +2035,7 @@ advanced_settings() {
else else
whiptail --msgbox "Default bridge 'vmbr0' not found!\n\nPlease configure a network bridge in Proxmox first." 10 58 whiptail --msgbox "Default bridge 'vmbr0' not found!\n\nPlease configure a network bridge in Proxmox first." 10 58
msg_error "Default bridge 'vmbr0' not found" msg_error "Default bridge 'vmbr0' not found"
exit 1 exit 116
fi fi
else else
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
@@ -3023,7 +3023,7 @@ install_script() {
3 | mydefaults | MYDEFAULTS | userdefaults | USERDEFAULTS) 3 | mydefaults | MYDEFAULTS | userdefaults | USERDEFAULTS)
default_var_settings || { default_var_settings || {
msg_error "Failed to apply default.vars" msg_error "Failed to apply default.vars"
exit 1 exit 110
} }
defaults_target="/usr/local/community-scripts/default.vars" defaults_target="/usr/local/community-scripts/default.vars"
break break
@@ -3040,7 +3040,7 @@ install_script() {
break break
else else
msg_error "No App Defaults available for ${APP}" msg_error "No App Defaults available for ${APP}"
exit 1 exit 111
fi fi
;; ;;
"$SETTINGS_OPTION" | settings | SETTINGS) "$SETTINGS_OPTION" | settings | SETTINGS)
@@ -3051,7 +3051,7 @@ install_script() {
;; ;;
*) *)
msg_error "Invalid option: $CHOICE" msg_error "Invalid option: $CHOICE"
exit 1 exit 112
;; ;;
esac esac
done done
@@ -3135,7 +3135,7 @@ check_container_resources() {
read -r prompt </dev/tty read -r prompt </dev/tty
if [[ ! ${prompt,,} =~ ^(yes)$ ]]; then if [[ ! ${prompt,,} =~ ^(yes)$ ]]; then
msg_error "Aborted: under-provisioned LXC (${current_cpu} CPU/${current_ram}MB RAM < ${var_cpu} CPU/${var_ram}MB RAM)" msg_error "Aborted: under-provisioned LXC (${current_cpu} CPU/${current_ram}MB RAM < ${var_cpu} CPU/${var_ram}MB RAM)"
exit 1 exit 113
fi fi
else else
echo -e "" echo -e ""
@@ -3158,7 +3158,7 @@ check_container_storage() {
read -r prompt </dev/tty read -r prompt </dev/tty
if [[ ! ${prompt,,} =~ ^(y|yes)$ ]]; then if [[ ! ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_error "Aborted: storage too low (${usage}% used)" msg_error "Aborted: storage too low (${usage}% used)"
exit 1 exit 114
fi fi
fi fi
} }
@@ -3446,7 +3446,7 @@ start() {
3) 3)
clear clear
exit_script exit_script
exit exit 0
;; ;;
esac esac
ensure_profile_loaded ensure_profile_loaded
@@ -3556,7 +3556,7 @@ build_container() {
export FUNCTIONS_FILE_PATH="$(curl -fsSL "$_func_url")" export FUNCTIONS_FILE_PATH="$(curl -fsSL "$_func_url")"
if [[ -z "$FUNCTIONS_FILE_PATH" || ${#FUNCTIONS_FILE_PATH} -lt 100 ]]; then if [[ -z "$FUNCTIONS_FILE_PATH" || ${#FUNCTIONS_FILE_PATH} -lt 100 ]]; then
msg_error "Failed to download install functions from: $_func_url" msg_error "Failed to download install functions from: $_func_url"
exit 1 exit 115
fi fi
# Core exports for install.func # Core exports for install.func
@@ -3938,7 +3938,7 @@ EOF
local ct_status local ct_status
ct_status=$(pct status "$CTID" 2>/dev/null || echo "unknown") ct_status=$(pct status "$CTID" 2>/dev/null || echo "unknown")
msg_error "LXC Container did not reach running state (status: ${ct_status})" msg_error "LXC Container did not reach running state (status: ${ct_status})"
exit 1 exit 117
fi fi
done done
@@ -3967,7 +3967,7 @@ EOF
echo " • Verify static IP configuration (if using static IP)" echo " • Verify static IP configuration (if using static IP)"
echo " • Check Proxmox firewall rules" echo " • Check Proxmox firewall rules"
echo " • If using Tailscale: Disable MagicDNS temporarily" echo " • If using Tailscale: Disable MagicDNS temporarily"
exit 1 exit 118
fi fi
# Verify basic connectivity (ping test) # Verify basic connectivity (ping test)
@@ -4094,21 +4094,8 @@ EOF'
# that sends "configuring" status AFTER the host already reported "failed" # that sends "configuring" status AFTER the host already reported "failed"
export CONTAINER_INSTALLING=true export CONTAINER_INSTALLING=true
# Capture lxc-attach terminal output to host-side log via tee. lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/${var_install}.sh)"
# This is the ONLY reliable way to get install output when: local lxc_exit=$?
# - install.func fails to load (DNS error) → no container-side logging
# - install script crashes before logging starts
# - $STD/silent() not used for some commands
# PIPESTATUS[0] gets the real exit code from lxc-attach (not from tee).
# Note: stdin is redirected from /dev/null so the pipeline does not consume
# the host's stdin/tty. This keeps /dev/tty usable for the recovery menu
# after SIGINT or failure (prevents "read: read error: Input/output error").
local _LXC_CAPTURE_LOG="/tmp/.install-capture-${SESSION_ID}.log"
lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/${var_install}.sh)" </dev/null 2>&1 | tee "$_LXC_CAPTURE_LOG"
local lxc_exit=${PIPESTATUS[0]}
# Restore terminal state after pipeline (tee/lxc-attach may leave it broken)
stty sane 2>/dev/null || true
unset CONTAINER_INSTALLING unset CONTAINER_INSTALLING
@@ -4170,19 +4157,9 @@ EOF'
build_log_copied=true build_log_copied=true
fi fi
# Copy and append INSTALL_LOG from container (with timeout to prevent hangs) # Copy and append INSTALL_LOG from container
local temp_install_log="/tmp/.install-temp-${SESSION_ID}.log" local temp_install_log="/tmp/.install-temp-${SESSION_ID}.log"
local container_log_ok=false if pct pull "$CTID" "/root/.install-${SESSION_ID}.log" "$temp_install_log" 2>/dev/null; then
if timeout 8 pct pull "$CTID" "/root/.install-${SESSION_ID}.log" "$temp_install_log" 2>/dev/null; then
# Only use container log if it has meaningful content (>100 bytes)
if [[ -s "$temp_install_log" ]] && [[ $(stat -c%s "$temp_install_log" 2>/dev/null || echo 0) -gt 100 ]]; then
container_log_ok=true
fi
fi
# PHASE 2: Use container-side log if available, otherwise use host-captured tee output
local _LXC_CAPTURE_LOG="/tmp/.install-capture-${SESSION_ID}.log"
if [[ "$container_log_ok" == true ]]; then
{ {
echo "================================================================================" echo "================================================================================"
echo "PHASE 2: APPLICATION INSTALLATION (Container)" echo "PHASE 2: APPLICATION INSTALLATION (Container)"
@@ -4190,24 +4167,8 @@ EOF'
cat "$temp_install_log" cat "$temp_install_log"
echo "" echo ""
} >>"$combined_log" } >>"$combined_log"
rm -f "$temp_install_log"
install_log_copied=true install_log_copied=true
elif [[ -s "$_LXC_CAPTURE_LOG" ]]; then
# Fallback: host-captured terminal output from lxc-attach
# This captures everything the user saw, including errors when install.func
# failed to load (DNS issues, etc.) and no container-side logging was set up.
{
echo "================================================================================"
echo "PHASE 2: APPLICATION INSTALLATION (Container - captured from terminal)"
echo "================================================================================"
# Strip ANSI escape codes from terminal capture
sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' "$_LXC_CAPTURE_LOG" | sed 's/\r$//'
echo ""
} >>"$combined_log"
install_log_copied=true
fi
rm -f "$temp_install_log"
if [[ "$install_log_copied" == true ]]; then
# Point INSTALL_LOG to combined log so get_full_log() finds it # Point INSTALL_LOG to combined log so get_full_log() finds it
INSTALL_LOG="$combined_log" INSTALL_LOG="$combined_log"
fi fi
@@ -4393,10 +4354,8 @@ EOF'
echo "" echo ""
echo -en "${YW}Select option [1-${max_option}] (default: 1, auto-remove in 60s): ${CL}" echo -en "${YW}Select option [1-${max_option}] (default: 1, auto-remove in 60s): ${CL}"
# Ensure terminal is sane before reading input (lxc-attach|tee may corrupt tty state) local response=""
stty sane 2>/dev/null || true if read -t 60 -r response; then
if read -t 60 -r response </dev/tty; then
case "${response:-1}" in case "${response:-1}" in
1) 1)
# Remove container # Remove container
@@ -4483,10 +4442,8 @@ EOF'
# Re-run install script in existing container (don't destroy/recreate) # Re-run install script in existing container (don't destroy/recreate)
set +Eeuo pipefail set +Eeuo pipefail
trap - ERR trap - ERR
local _LXC_CAPTURE_LOG="/tmp/.install-capture-${SESSION_ID}.log" lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/${var_install}.sh)"
lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/${var_install}.sh)" </dev/null 2>&1 | tee "$_LXC_CAPTURE_LOG" local apt_retry_exit=$?
local apt_retry_exit=${PIPESTATUS[0]}
stty sane 2>/dev/null || true
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler' ERR trap 'error_handler' ERR
@@ -4596,9 +4553,6 @@ EOF'
exit $install_exit_code exit $install_exit_code
fi fi
# Clean up host-side capture log (not needed on success, already in combined_log on failure)
rm -f "/tmp/.install-capture-${SESSION_ID}.log" 2>/dev/null
# Re-enable error handling after successful install or recovery menu completion # Re-enable error handling after successful install or recovery menu completion
set -Eeuo pipefail set -Eeuo pipefail
trap 'error_handler' ERR trap 'error_handler' ERR
@@ -5014,11 +4968,11 @@ create_lxc_container() {
# Storage capability check # Storage capability check
check_storage_support "rootdir" || { check_storage_support "rootdir" || {
msg_error "No valid storage found for 'rootdir' [Container]" msg_error "No valid storage found for 'rootdir' [Container]"
exit 1 exit 119
} }
check_storage_support "vztmpl" || { check_storage_support "vztmpl" || {
msg_error "No valid storage found for 'vztmpl' [Template]" msg_error "No valid storage found for 'vztmpl' [Template]"
exit 1 exit 120
} }
# Template storage selection # Template storage selection
@@ -5296,7 +5250,7 @@ create_lxc_container() {
} }
else else
msg_custom "🚫" "${YW}" "Installation cancelled" msg_custom "🚫" "${YW}" "Installation cancelled"
exit 1 exit 0
fi fi
else else
msg_error "No ${PCT_OSTYPE} templates available" msg_error "No ${PCT_OSTYPE} templates available"

View File

@@ -276,7 +276,7 @@ shell_check() {
msg_error "Your default shell is currently not set to Bash. To use these scripts, please switch to the Bash shell." msg_error "Your default shell is currently not set to Bash. To use these scripts, please switch to the Bash shell."
echo -e "\nExiting..." echo -e "\nExiting..."
sleep 2 sleep 2
exit 1 exit 103
fi fi
} }
@@ -293,7 +293,7 @@ root_check() {
msg_error "Please run this script as root." msg_error "Please run this script as root."
echo -e "\nExiting..." echo -e "\nExiting..."
sleep 2 sleep 2
exit 1 exit 104
fi fi
} }
@@ -314,7 +314,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -325,7 +325,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not yet supported." msg_error "This version of Proxmox VE is not yet supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -333,7 +333,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.9 or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.9 or 9.0 9.1"
exit 1 exit 105
} }
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -348,7 +348,7 @@ arch_check() {
msg_error "This script will not work with PiMox (ARM architecture detected)." msg_error "This script will not work with PiMox (ARM architecture detected)."
msg_warn "Visit https://github.com/asylumexp/Proxmox for ARM64 support." msg_warn "Visit https://github.com/asylumexp/Proxmox for ARM64 support."
sleep 2 sleep 2
exit 1 exit 106
fi fi
} }

View File

@@ -94,6 +94,29 @@ if ! declare -f explain_exit_code &>/dev/null; then
100) echo "APT: Package manager error (broken packages / dependency problems)" ;; 100) echo "APT: Package manager error (broken packages / dependency problems)" ;;
101) echo "APT: Configuration error (bad sources.list, malformed config)" ;; 101) echo "APT: Configuration error (bad sources.list, malformed config)" ;;
102) echo "APT: Lock held by another process (dpkg/apt still running)" ;; 102) echo "APT: Lock held by another process (dpkg/apt still running)" ;;
# --- Script Validation & Setup (103-123) ---
103) echo "Validation: Shell is not Bash" ;;
104) echo "Validation: Not running as root (or invoked via sudo)" ;;
105) echo "Validation: Proxmox VE version not supported" ;;
106) echo "Validation: Architecture not supported (ARM / PiMox)" ;;
107) echo "Validation: Kernel key parameters unreadable" ;;
108) echo "Validation: Kernel key limits exceeded" ;;
109) echo "Proxmox: No available container ID after max attempts" ;;
110) echo "Proxmox: Failed to apply default.vars" ;;
111) echo "Proxmox: App defaults file not available" ;;
112) echo "Proxmox: Invalid install menu option" ;;
113) echo "LXC: Under-provisioned — user aborted update" ;;
114) echo "LXC: Storage too low — user aborted update" ;;
115) echo "Download: install.func download failed or incomplete" ;;
116) echo "Proxmox: Default bridge vmbr0 not found" ;;
117) echo "LXC: Container did not reach running state" ;;
118) echo "LXC: No IP assigned to container after timeout" ;;
119) echo "Proxmox: No valid storage for rootdir content" ;;
120) echo "Proxmox: No valid storage for vztmpl content" ;;
121) echo "LXC: Container network not ready (no IP after retries)" ;;
122) echo "LXC: No internet connectivity — user declined to continue" ;;
123) echo "LXC: Local IP detection failed" ;;
124) echo "Command timed out (timeout command)" ;; 124) echo "Command timed out (timeout command)" ;;
125) echo "Command failed to start (Docker daemon or execution error)" ;; 125) echo "Command failed to start (Docker daemon or execution error)" ;;
126) echo "Command invoked cannot execute (permission problem?)" ;; 126) echo "Command invoked cannot execute (permission problem?)" ;;
@@ -155,6 +178,16 @@ if ! declare -f explain_exit_code &>/dev/null; then
224) echo "Proxmox: PBS storage is for backups only" ;; 224) echo "Proxmox: PBS storage is for backups only" ;;
225) echo "Proxmox: No template available for OS/Version" ;; 225) echo "Proxmox: No template available for OS/Version" ;;
231) echo "Proxmox: LXC stack upgrade failed" ;; 231) echo "Proxmox: LXC stack upgrade failed" ;;
# --- Tools & Addon Scripts (232-238) ---
232) echo "Tools: Wrong execution environment (run on PVE host, not inside LXC)" ;;
233) echo "Tools: Application not installed (update prerequisite missing)" ;;
234) echo "Tools: No LXC containers found or available" ;;
235) echo "Tools: Backup or restore operation failed" ;;
236) echo "Tools: Required hardware not detected" ;;
237) echo "Tools: Dependency package installation failed" ;;
238) echo "Tools: OS or distribution not supported for this addon" ;;
239) echo "npm/Node.js: Unexpected runtime error or dependency failure" ;; 239) echo "npm/Node.js: Unexpected runtime error or dependency failure" ;;
243) echo "Node.js: Out of memory (JavaScript heap out of memory)" ;; 243) echo "Node.js: Out of memory (JavaScript heap out of memory)" ;;
245) echo "Node.js: Invalid command-line option" ;; 245) echo "Node.js: Invalid command-line option" ;;
@@ -286,7 +319,9 @@ error_handler() {
echo -en "${YW}Remove broken container ${CTID}? (Y/n) [auto-remove in 60s]: ${CL}" echo -en "${YW}Remove broken container ${CTID}? (Y/n) [auto-remove in 60s]: ${CL}"
fi fi
if read -t 60 -r response </dev/tty; then # Read user response
local response=""
if read -t 60 -r response; then
if [[ -z "$response" || "$response" =~ ^[Yy]$ ]]; then if [[ -z "$response" || "$response" =~ ^[Yy]$ ]]; then
echo "" echo ""
if declare -f msg_info >/dev/null 2>&1; then if declare -f msg_info >/dev/null 2>&1; then

View File

@@ -126,7 +126,7 @@ setting_up_container() {
if [ "$(hostname -I)" = "" ]; then if [ "$(hostname -I)" = "" ]; then
echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}" echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
echo -e "${NETWORK}Check Network Settings" echo -e "${NETWORK}Check Network Settings"
exit 1 exit 121
fi fi
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
systemctl disable -q --now systemd-networkd-wait-online.service systemctl disable -q --now systemd-networkd-wait-online.service
@@ -177,7 +177,7 @@ network_check() {
echo -e "${INFO}${RD}Expect Issues Without Internet${CL}" echo -e "${INFO}${RD}Expect Issues Without Internet${CL}"
else else
echo -e "${NETWORK}Check Network Settings" echo -e "${NETWORK}Check Network Settings"
exit 1 exit 122
fi fi
fi fi
@@ -242,12 +242,12 @@ EOF
local tools_content local tools_content
tools_content=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) || { tools_content=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) || {
msg_error "Failed to download tools.func" msg_error "Failed to download tools.func"
exit 6 exit 115
} }
source /dev/stdin <<<"$tools_content" source /dev/stdin <<<"$tools_content"
if ! declare -f fetch_and_deploy_gh_release >/dev/null 2>&1; then if ! declare -f fetch_and_deploy_gh_release >/dev/null 2>&1; then
msg_error "tools.func loaded but incomplete — missing expected functions" msg_error "tools.func loaded but incomplete — missing expected functions"
exit 6 exit 115
fi fi
} }

View File

@@ -934,7 +934,11 @@ upgrade_package() {
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Repository availability check with caching # Repository availability check with caching
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
declare -A _REPO_CACHE 2>/dev/null || true # Note: Must use -gA (global) because tools.func is sourced inside update_os()
# function scope. Plain 'declare -A' would create a local variable that gets
# destroyed when update_os() returns, causing "unbound variable" errors later
# when setup_postgresql/verify_repo_available tries to access the cache key.
declare -gA _REPO_CACHE 2>/dev/null || declare -A _REPO_CACHE 2>/dev/null || true
verify_repo_available() { verify_repo_available() {
local repo_url="$1" local repo_url="$1"
@@ -1732,6 +1736,13 @@ setup_deb822_repo() {
rm -f "$tmp_gpg" rm -f "$tmp_gpg"
return 1 return 1
} }
else
# Already binary — copy directly
cp -f "$tmp_gpg" "/etc/apt/keyrings/${name}.gpg" || {
msg_error "Failed to install GPG key for ${name}"
rm -f "$tmp_gpg"
return 1
}
fi fi
rm -f "$tmp_gpg" rm -f "$tmp_gpg"
chmod 644 "/etc/apt/keyrings/${name}.gpg" chmod 644 "/etc/apt/keyrings/${name}.gpg"
@@ -5142,7 +5153,7 @@ current_ip="$(get_current_ip)"
if [[ -z "$current_ip" ]]; then if [[ -z "$current_ip" ]]; then
echo "[ERROR] Could not detect local IP" >&2 echo "[ERROR] Could not detect local IP" >&2
exit 1 exit 123
fi fi
if [[ -f "$IP_FILE" ]]; then if [[ -f "$IP_FILE" ]]; then
@@ -5643,20 +5654,20 @@ function setup_mongodb() {
# - Handles Debian Trixie libaio1t64 transition # - Handles Debian Trixie libaio1t64 transition
# #
# Variables: # Variables:
# USE_MYSQL_REPO - Set to "true" to use official MySQL repository # USE_MYSQL_REPO - Use official MySQL repository (default: true)
# (default: false, uses distro packages) # Set to "false" to use distro packages instead
# MYSQL_VERSION - MySQL version to install when using official repo # MYSQL_VERSION - MySQL version to install when using official repo
# (e.g. 8.0, 8.4) (default: 8.0) # (e.g. 8.0, 8.4) (default: 8.0)
# #
# Examples: # Examples:
# setup_mysql # Uses distro package (recommended) # setup_mysql # Uses official MySQL repo, 8.0
# USE_MYSQL_REPO=true setup_mysql # Uses official MySQL repo # MYSQL_VERSION="8.4" setup_mysql # Specific version from MySQL repo
# USE_MYSQL_REPO=true MYSQL_VERSION="8.4" setup_mysql # Specific version # USE_MYSQL_REPO=false setup_mysql # Uses distro package instead
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
function setup_mysql() { function setup_mysql() {
local MYSQL_VERSION="${MYSQL_VERSION:-8.0}" local MYSQL_VERSION="${MYSQL_VERSION:-8.0}"
local USE_MYSQL_REPO="${USE_MYSQL_REPO:-false}" local USE_MYSQL_REPO="${USE_MYSQL_REPO:-true}"
local DISTRO_ID DISTRO_CODENAME local DISTRO_ID DISTRO_CODENAME
DISTRO_ID=$(awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '"') DISTRO_ID=$(awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '"')
DISTRO_CODENAME=$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release) DISTRO_CODENAME=$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release)
@@ -6357,21 +6368,21 @@ EOF
# - Restores dumped data post-upgrade # - Restores dumped data post-upgrade
# #
# Variables: # Variables:
# USE_PGDG_REPO - Set to "true" to use official PGDG repository # USE_PGDG_REPO - Use official PGDG repository (default: true)
# (default: false, uses distro packages) # Set to "false" to use distro packages instead
# PG_VERSION - Major PostgreSQL version (e.g. 15, 16) (default: 16) # PG_VERSION - Major PostgreSQL version (e.g. 15, 16) (default: 16)
# PG_MODULES - Comma-separated list of modules (e.g. "postgis,contrib") # PG_MODULES - Comma-separated list of modules (e.g. "postgis,contrib")
# #
# Examples: # Examples:
# setup_postgresql # Uses distro package (recommended) # setup_postgresql # Uses PGDG repo, PG 16
# USE_PGDG_REPO=true setup_postgresql # Uses official PGDG repo # PG_VERSION="17" setup_postgresql # Specific version from PGDG
# USE_PGDG_REPO=true PG_VERSION="17" setup_postgresql # Specific version from PGDG # USE_PGDG_REPO=false setup_postgresql # Uses distro package instead
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
function setup_postgresql() { function setup_postgresql() {
local PG_VERSION="${PG_VERSION:-16}" local PG_VERSION="${PG_VERSION:-16}"
local PG_MODULES="${PG_MODULES:-}" local PG_MODULES="${PG_MODULES:-}"
local USE_PGDG_REPO="${USE_PGDG_REPO:-false}" local USE_PGDG_REPO="${USE_PGDG_REPO:-true}"
local DISTRO_ID DISTRO_CODENAME local DISTRO_ID DISTRO_CODENAME
DISTRO_ID=$(awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '"') DISTRO_ID=$(awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '"')
DISTRO_CODENAME=$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release) DISTRO_CODENAME=$(awk -F= '/^VERSION_CODENAME=/{print $2}' /etc/os-release)

View File

@@ -244,7 +244,7 @@ curl_handler() {
if [[ -z "$url" ]]; then if [[ -z "$url" ]]; then
msg_error "no valid url or option entered for curl_handler" msg_error "no valid url or option entered for curl_handler"
exit 1 exit 64
fi fi
$STD msg_info "Fetching: $url" $STD msg_info "Fetching: $url"
@@ -273,7 +273,7 @@ curl_handler() {
rm -f /tmp/curl_error.log rm -f /tmp/curl_error.log
fi fi
__curl_err_handler "$exit_code" "$url" "$curl_stderr" __curl_err_handler "$exit_code" "$url" "$curl_stderr"
exit 1 # hard exit if exit_code is not 0 exit "$exit_code"
fi fi
$STD printf "\r\033[K${INFO}${YW}Retry $attempt/$max_retries in ${delay}s...${CL}" >&2 $STD printf "\r\033[K${INFO}${YW}Retry $attempt/$max_retries in ${delay}s...${CL}" >&2
@@ -316,7 +316,7 @@ __curl_err_handler() {
esac esac
[[ -n "$curl_msg" ]] && printf "%s\n" "$curl_msg" >&2 [[ -n "$curl_msg" ]] && printf "%s\n" "$curl_msg" >&2
exit 1 exit "$exit_code"
} }
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -331,7 +331,7 @@ shell_check() {
msg_error "Your default shell is currently not set to Bash. To use these scripts, please switch to the Bash shell." msg_error "Your default shell is currently not set to Bash. To use these scripts, please switch to the Bash shell."
echo -e "\nExiting..." echo -e "\nExiting..."
sleep 2 sleep 2
exit exit 103
fi fi
} }
@@ -552,7 +552,7 @@ check_root() {
msg_error "Please run this script as root." msg_error "Please run this script as root."
echo -e "\nExiting..." echo -e "\nExiting..."
sleep 2 sleep 2
exit exit 104
fi fi
} }
@@ -562,7 +562,7 @@ pve_check() {
echo -e "Requires Proxmox Virtual Environment Version 8.1 - 8.4 or 9.0 - 9.1." echo -e "Requires Proxmox Virtual Environment Version 8.1 - 8.4 or 9.0 - 9.1."
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit 105
fi fi
} }
@@ -572,21 +572,21 @@ arch_check() {
echo -e "\n ${YWB}Visit https://github.com/asylumexp/Proxmox for ARM64 support. \n" echo -e "\n ${YWB}Visit https://github.com/asylumexp/Proxmox for ARM64 support. \n"
echo -e "Exiting..." echo -e "Exiting..."
sleep 2 sleep 2
exit exit 106
fi fi
} }
exit_script() { exit_script() {
clear clear
echo -e "\n${CROSS}${RD}User exited script${CL}\n" echo -e "\n${CROSS}${RD}User exited script${CL}\n"
exit exit 0
} }
check_hostname_conflict() { check_hostname_conflict() {
local hostname="$1" local hostname="$1"
if qm list | awk '{print $2}' | grep -qx "$hostname"; then if qm list | awk '{print $2}' | grep -qx "$hostname"; then
msg_error "Hostname $hostname already in use by another VM." msg_error "Hostname $hostname already in use by another VM."
exit 1 exit 206
fi fi
} }

View File

@@ -73,7 +73,7 @@ fi
DISTRO=$(pct exec "$CTID" -- cat /etc/os-release | grep -w "ID" | cut -d'=' -f2 | tr -d '"') DISTRO=$(pct exec "$CTID" -- cat /etc/os-release | grep -w "ID" | cut -d'=' -f2 | tr -d '"')
if [[ "$DISTRO" != "debian" && "$DISTRO" != "ubuntu" ]]; then if [[ "$DISTRO" != "debian" && "$DISTRO" != "ubuntu" ]]; then
msg "\e[1;31m Error: This script only supports Debian or Ubuntu LXC containers. Detected: $DISTRO. Aborting...\e[0m" msg "\e[1;31m Error: This script only supports Debian or Ubuntu LXC containers. Detected: $DISTRO. Aborting...\e[0m"
exit 1 exit 238
fi fi
CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf

View File

@@ -32,7 +32,7 @@ header_info
if ! command -v pveversion &>/dev/null; then if ! command -v pveversion &>/dev/null; then
msg_error "This script must be run on the Proxmox VE host (not inside an LXC container)" msg_error "This script must be run on the Proxmox VE host (not inside an LXC container)"
exit 1 exit 232
fi fi
while true; do while true; do
@@ -64,7 +64,7 @@ while [[ -z "${CTID}" ]]; do
CTID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Containers on $NODE" --radiolist \ CTID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Containers on $NODE" --radiolist \
"\nSelect a container to add Tailscale to:\n" \ "\nSelect a container to add Tailscale to:\n" \
16 $((MSG_MAX_LENGTH + 23)) 6 \ 16 $((MSG_MAX_LENGTH + 23)) 6 \
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit 1 "${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit 0
done done
CTID_CONFIG_PATH="/etc/pve/lxc/${CTID}.conf" CTID_CONFIG_PATH="/etc/pve/lxc/${CTID}.conf"

View File

@@ -69,7 +69,7 @@ elif [[ -f "/etc/debian_version" ]]; then
SERVICE_PATH="/etc/systemd/system/adguardhome-sync.service" SERVICE_PATH="/etc/systemd/system/adguardhome-sync.service"
else else
msg_error "Unsupported OS detected. Exiting." msg_error "Unsupported OS detected. Exiting."
exit 1 exit 238
fi fi
# ============================================================================== # ==============================================================================
@@ -312,7 +312,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -87,11 +87,11 @@ function update() {
function check_docker() { function check_docker() {
if ! command -v docker &>/dev/null; then if ! command -v docker &>/dev/null; then
msg_error "Docker is not installed. This script requires an existing Docker LXC. Exiting." msg_error "Docker is not installed. This script requires an existing Docker LXC. Exiting."
exit 1 exit 10
fi fi
if ! docker compose version &>/dev/null; then if ! docker compose version &>/dev/null; then
msg_error "Docker Compose plugin is not available. Please install it before running this script. Exiting." msg_error "Docker Compose plugin is not available. Please install it before running this script. Exiting."
exit 1 exit 10
fi fi
msg_ok "Docker $(docker --version | cut -d' ' -f3 | tr -d ',') and Docker Compose are available" msg_ok "Docker $(docker --version | cut -d' ' -f3 | tr -d ',') and Docker Compose are available"
} }
@@ -171,7 +171,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -93,7 +93,7 @@ function check_or_install_docker() {
msg_ok "Docker Compose is available" msg_ok "Docker Compose is available"
else else
msg_error "Docker Compose plugin is not available. Please install it." msg_error "Docker Compose plugin is not available. Please install it."
exit 1 exit 10
fi fi
return return
fi fi
@@ -103,7 +103,7 @@ function check_or_install_docker() {
read -r install_docker_prompt read -r install_docker_prompt
if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_error "Docker is required for ${APP}. Exiting." msg_error "Docker is required for ${APP}. Exiting."
exit 1 exit 10
fi fi
msg_info "Installing Docker" msg_info "Installing Docker"
@@ -165,7 +165,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -49,7 +49,7 @@ elif grep -qE 'ID=debian|ID=ubuntu' /etc/os-release; then
SERVICE_PATH="/etc/systemd/system/copyparty.service" SERVICE_PATH="/etc/systemd/system/copyparty.service"
else else
msg_error "Unsupported OS detected. Exiting." msg_error "Unsupported OS detected. Exiting."
exit 1 exit 238
fi fi
# ============================================================================== # ==============================================================================
@@ -318,7 +318,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -51,7 +51,7 @@ EOF
# ============================================================================== # ==============================================================================
if ! grep -qE 'ID=debian|ID=ubuntu' /etc/os-release 2>/dev/null; then if ! grep -qE 'ID=debian|ID=ubuntu' /etc/os-release 2>/dev/null; then
echo -e "${CROSS} Unsupported OS detected. This script only supports Debian and Ubuntu." echo -e "${CROSS} Unsupported OS detected. This script only supports Debian and Ubuntu."
exit 1 exit 238
fi fi
# ============================================================================== # ==============================================================================
@@ -183,7 +183,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -99,7 +99,7 @@ function check_or_install_docker() {
msg_ok "Docker Compose is available" msg_ok "Docker Compose is available"
else else
msg_error "Docker Compose plugin is not available. Please install it." msg_error "Docker Compose plugin is not available. Please install it."
exit 1 exit 10
fi fi
return return
fi fi
@@ -109,7 +109,7 @@ function check_or_install_docker() {
read -r install_docker_prompt read -r install_docker_prompt
if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_error "Docker is required for ${APP}. Exiting." msg_error "Docker is required for ${APP}. Exiting."
exit 1 exit 10
fi fi
msg_info "Installing Docker" msg_info "Installing Docker"
@@ -160,7 +160,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -92,7 +92,7 @@ function check_or_install_docker() {
msg_ok "Docker Compose is available" msg_ok "Docker Compose is available"
else else
msg_error "Docker Compose plugin is not available. Please install it." msg_error "Docker Compose plugin is not available. Please install it."
exit 1 exit 10
fi fi
return return
fi fi
@@ -102,7 +102,7 @@ function check_or_install_docker() {
read -r install_docker_prompt read -r install_docker_prompt
if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_error "Docker is required for ${APP}. Exiting." msg_error "Docker is required for ${APP}. Exiting."
exit 1 exit 10
fi fi
msg_info "Installing Docker" msg_info "Installing Docker"
@@ -163,7 +163,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -54,7 +54,7 @@ elif [[ -f "/etc/debian_version" ]]; then
PKG_MANAGER="apt-get install -y" PKG_MANAGER="apt-get install -y"
else else
echo -e "${CROSS} Unsupported OS detected. Exiting." echo -e "${CROSS} Unsupported OS detected. Exiting."
exit 1 exit 238
fi fi
header_info header_info

View File

@@ -52,7 +52,7 @@ elif [[ -f "/etc/debian_version" ]]; then
PKG_MANAGER="apt-get install -y" PKG_MANAGER="apt-get install -y"
else else
echo -e "${CROSS} Unsupported OS detected. Exiting." echo -e "${CROSS} Unsupported OS detected. Exiting."
exit 1 exit 238
fi fi
header_info header_info

View File

@@ -93,7 +93,7 @@ EOF
update_glances_debian() { update_glances_debian() {
if [[ ! -d /opt/glances/.venv ]]; then if [[ ! -d /opt/glances/.venv ]]; then
msg_error "$APP is not installed" msg_error "$APP is not installed"
exit 1 exit 233
fi fi
msg_info "Updating $APP" msg_info "Updating $APP"
cd /opt/glances cd /opt/glances
@@ -160,7 +160,7 @@ EOF
update_glances_alpine() { update_glances_alpine() {
if [[ ! -d /opt/glances/.venv ]]; then if [[ ! -d /opt/glances/.venv ]]; then
msg_error "$APP is not installed" msg_error "$APP is not installed"
exit 1 exit 233
fi fi
msg_info "Updating $APP" msg_info "Updating $APP"
cd /opt/glances cd /opt/glances

View File

@@ -52,13 +52,13 @@ EOF
# ============================================================================== # ==============================================================================
if [[ -f "/etc/alpine-release" ]]; then if [[ -f "/etc/alpine-release" ]]; then
msg_error "Alpine is not supported for ${APP}. Use Debian." msg_error "Alpine is not supported for ${APP}. Use Debian."
exit 1 exit 238
elif [[ -f "/etc/debian_version" ]]; then elif [[ -f "/etc/debian_version" ]]; then
OS="Debian" OS="Debian"
SERVICE_PATH="/etc/systemd/system/immich-proxy.service" SERVICE_PATH="/etc/systemd/system/immich-proxy.service"
else else
echo -e "${CROSS} Unsupported OS detected. Exiting." echo -e "${CROSS} Unsupported OS detected. Exiting."
exit 1 exit 238
fi fi
# ============================================================================== # ==============================================================================
@@ -231,7 +231,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -52,13 +52,13 @@ EOF
# ============================================================================== # ==============================================================================
if [[ -f "/etc/alpine-release" ]]; then if [[ -f "/etc/alpine-release" ]]; then
msg_error "Alpine is not supported for ${APP}. Use Debian/Ubuntu." msg_error "Alpine is not supported for ${APP}. Use Debian/Ubuntu."
exit 1 exit 238
elif [[ -f "/etc/debian_version" ]]; then elif [[ -f "/etc/debian_version" ]]; then
OS="Debian" OS="Debian"
SERVICE_PATH="/etc/systemd/system/jellystat.service" SERVICE_PATH="/etc/systemd/system/jellystat.service"
else else
echo -e "${CROSS} Unsupported OS detected. Exiting." echo -e "${CROSS} Unsupported OS detected. Exiting."
exit 1 exit 238
fi fi
# ============================================================================== # ==============================================================================
@@ -326,7 +326,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -37,7 +37,7 @@ function find_compose_file() {
COMPOSE_FILE=$(find "$INSTALL_PATH" -maxdepth 1 -type f -name '*.compose.yaml' ! -name 'compose.env' | head -n1) COMPOSE_FILE=$(find "$INSTALL_PATH" -maxdepth 1 -type f -name '*.compose.yaml' ! -name 'compose.env' | head -n1)
if [[ -z "${COMPOSE_FILE:-}" ]]; then if [[ -z "${COMPOSE_FILE:-}" ]]; then
msg_error "No valid compose file found in ${INSTALL_PATH}!" msg_error "No valid compose file found in ${INSTALL_PATH}!"
exit 1 exit 233
fi fi
COMPOSE_BASENAME=$(basename "$COMPOSE_FILE") COMPOSE_BASENAME=$(basename "$COMPOSE_FILE")
} }
@@ -48,7 +48,7 @@ function check_legacy_db() {
echo -e "${YW}This configuration is no longer supported since Komodo v1.18.0.${CL}" echo -e "${YW}This configuration is no longer supported since Komodo v1.18.0.${CL}"
echo -e "${YW}Please follow the migration guide:${CL}" echo -e "${YW}Please follow the migration guide:${CL}"
echo -e "${BGN}https://github.com/community-scripts/ProxmoxVE/discussions/5689${CL}\n" echo -e "${BGN}https://github.com/community-scripts/ProxmoxVE/discussions/5689${CL}\n"
exit 1 exit 238
fi fi
} }
@@ -79,14 +79,14 @@ function update() {
BACKUP_FILE="${INSTALL_PATH}/${COMPOSE_BASENAME}.bak_$(date +%Y%m%d_%H%M%S)" BACKUP_FILE="${INSTALL_PATH}/${COMPOSE_BASENAME}.bak_$(date +%Y%m%d_%H%M%S)"
cp "$COMPOSE_FILE" "$BACKUP_FILE" || { cp "$COMPOSE_FILE" "$BACKUP_FILE" || {
msg_error "Failed to create backup of ${COMPOSE_BASENAME}!" msg_error "Failed to create backup of ${COMPOSE_BASENAME}!"
exit 1 exit 235
} }
GITHUB_URL="https://raw.githubusercontent.com/moghtech/komodo/main/compose/${COMPOSE_BASENAME}" GITHUB_URL="https://raw.githubusercontent.com/moghtech/komodo/main/compose/${COMPOSE_BASENAME}"
if ! curl -fsSL "$GITHUB_URL" -o "$COMPOSE_FILE"; then if ! curl -fsSL "$GITHUB_URL" -o "$COMPOSE_FILE"; then
msg_error "Failed to download ${COMPOSE_BASENAME} from GitHub!" msg_error "Failed to download ${COMPOSE_BASENAME} from GitHub!"
mv "$BACKUP_FILE" "$COMPOSE_FILE" mv "$BACKUP_FILE" "$COMPOSE_FILE"
exit 1 exit 115
fi fi
if ! grep -qxF 'COMPOSE_KOMODO_BACKUPS_PATH=/etc/komodo/backups' "$COMPOSE_ENV"; then if ! grep -qxF 'COMPOSE_KOMODO_BACKUPS_PATH=/etc/komodo/backups' "$COMPOSE_ENV"; then
@@ -129,7 +129,7 @@ function check_or_install_docker() {
msg_ok "Docker Compose is available" msg_ok "Docker Compose is available"
else else
msg_error "Docker Compose plugin is not available. Please install it." msg_error "Docker Compose plugin is not available. Please install it."
exit 1 exit 10
fi fi
return return
fi fi
@@ -139,7 +139,7 @@ function check_or_install_docker() {
read -r install_docker_prompt read -r install_docker_prompt
if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_error "Docker is required for ${APP}. Exiting." msg_error "Docker is required for ${APP}. Exiting."
exit 1 exit 10
fi fi
msg_info "Installing Docker" msg_info "Installing Docker"
@@ -239,7 +239,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -58,7 +58,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -69,7 +69,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not yet supported." msg_error "This version of Proxmox VE is not yet supported."
msg_error "Supported: Proxmox VE version 9.09.1.x" msg_error "Supported: Proxmox VE version 9.09.1.x"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -77,19 +77,19 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.9 or 9.09.1.x" msg_error "Supported versions: Proxmox VE 8.0 8.9 or 9.09.1.x"
exit 1 exit 105
} }
detect_codename() { detect_codename() {
source /etc/os-release source /etc/os-release
if [[ "$ID" != "debian" ]]; then if [[ "$ID" != "debian" ]]; then
msg_error "Unsupported base OS: $ID (only Proxmox VE / Debian supported)." msg_error "Unsupported base OS: $ID (only Proxmox VE / Debian supported)."
exit 1 exit 238
fi fi
CODENAME="${VERSION_CODENAME:-}" CODENAME="${VERSION_CODENAME:-}"
if [[ -z "$CODENAME" ]]; then if [[ -z "$CODENAME" ]]; then
msg_error "Could not detect Debian codename." msg_error "Could not detect Debian codename."
exit 1 exit 71
fi fi
echo "$CODENAME" echo "$CODENAME"
} }
@@ -124,7 +124,7 @@ install() {
PKG=$(get_latest_repo_pkg "$REPO_URL") PKG=$(get_latest_repo_pkg "$REPO_URL")
if [[ -z "$PKG" ]]; then if [[ -z "$PKG" ]]; then
msg_error "Could not find netdata-repo package for Debian $CODENAME" msg_error "Could not find netdata-repo package for Debian $CODENAME"
exit 1 exit 237
fi fi
curl -fsSL "${REPO_URL}${PKG}" -o "$PKG" curl -fsSL "${REPO_URL}${PKG}" -o "$PKG"
$STD dpkg -i "$PKG" $STD dpkg -i "$PKG"

View File

@@ -36,7 +36,7 @@ SERVICE_PATH="/etc/systemd/system/nextcloud-exporter.service"
# ============================================================================== # ==============================================================================
if ! grep -qE 'ID=debian|ID=ubuntu' /etc/os-release 2>/dev/null; then if ! grep -qE 'ID=debian|ID=ubuntu' /etc/os-release 2>/dev/null; then
echo -e "${CROSS} Unsupported OS detected. This script only supports Debian and Ubuntu." echo -e "${CROSS} Unsupported OS detected. This script only supports Debian and Ubuntu."
exit 1 exit 238
fi fi
# ============================================================================== # ==============================================================================
@@ -170,7 +170,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "Nextcloud-Exporter is not installed. Nothing to update." msg_error "Nextcloud-Exporter is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -52,7 +52,7 @@ elif [[ -f "/etc/debian_version" ]]; then
INSTALL_DIR="$INSTALL_DIR_DEBIAN" INSTALL_DIR="$INSTALL_DIR_DEBIAN"
else else
echo -e "${CROSS} Unsupported OS detected. Exiting." echo -e "${CROSS} Unsupported OS detected. Exiting."
exit 1 exit 238
fi fi
header_info header_info
@@ -72,7 +72,7 @@ function check_internet() {
msg_ok "Internet connectivity OK" msg_ok "Internet connectivity OK"
else else
msg_error "Internet connectivity or GitHub unreachable (Status $HTTP_CODE). Exiting." msg_error "Internet connectivity or GitHub unreachable (Status $HTTP_CODE). Exiting."
exit 1 exit 115
fi fi
} }
@@ -105,7 +105,7 @@ function install_php_and_modules() {
msg_info "Installing missing PHP packages: ${MISSING_PACKAGES[*]}" msg_info "Installing missing PHP packages: ${MISSING_PACKAGES[*]}"
if ! apt-get update &>/dev/null || ! apt-get install -y "${MISSING_PACKAGES[@]}" &>/dev/null; then if ! apt-get update &>/dev/null || ! apt-get install -y "${MISSING_PACKAGES[@]}" &>/dev/null; then
msg_error "Failed to install required PHP modules. Exiting." msg_error "Failed to install required PHP modules. Exiting."
exit 1 exit 237
fi fi
msg_ok "Installed missing PHP packages" msg_ok "Installed missing PHP packages"
else else
@@ -132,7 +132,7 @@ function install_phpmyadmin() {
msg_info "Downloading ${TARBALL_URL}" msg_info "Downloading ${TARBALL_URL}"
if ! curl -fsSL "$TARBALL_URL" -o /tmp/phpmyadmin.tar.gz; then if ! curl -fsSL "$TARBALL_URL" -o /tmp/phpmyadmin.tar.gz; then
msg_error "Download failed: $TARBALL_URL" msg_error "Download failed: $TARBALL_URL"
exit 1 exit 115
fi fi
mkdir -p "$INSTALL_DIR" mkdir -p "$INSTALL_DIR"
@@ -188,7 +188,7 @@ EOF
msg_ok "Started PHP-FPM service: $PHP_FPM_SERVICE" msg_ok "Started PHP-FPM service: $PHP_FPM_SERVICE"
else else
msg_error "Failed to start PHP-FPM service: $PHP_FPM_SERVICE" msg_error "Failed to start PHP-FPM service: $PHP_FPM_SERVICE"
exit 1 exit 150
fi fi
$STD rc-service lighttpd start $STD rc-service lighttpd start
@@ -237,7 +237,7 @@ function update_phpmyadmin() {
if ! curl -fsSL "$TARBALL_URL" -o /tmp/phpmyadmin.tar.gz; then if ! curl -fsSL "$TARBALL_URL" -o /tmp/phpmyadmin.tar.gz; then
msg_error "Download failed: $TARBALL_URL" msg_error "Download failed: $TARBALL_URL"
exit 1 exit 115
fi fi
BACKUP_DIR="/tmp/phpmyadmin-backup-$(date +%Y%m%d-%H%M%S)" BACKUP_DIR="/tmp/phpmyadmin-backup-$(date +%Y%m%d-%H%M%S)"
@@ -280,7 +280,7 @@ if is_phpmyadmin_installed; then
;; ;;
*) *)
echo -e "${YW}⚠️ Invalid input. Exiting.${CL}" echo -e "${YW}⚠️ Invalid input. Exiting.${CL}"
exit 1 exit 112
;; ;;
esac esac
else else

View File

@@ -41,7 +41,7 @@ elif grep -qE 'ID=debian|ID=ubuntu' /etc/os-release; then
SERVICE_PATH="/etc/systemd/system/pihole-exporter.service" SERVICE_PATH="/etc/systemd/system/pihole-exporter.service"
else else
echo -e "${CROSS} Unsupported OS detected. Exiting." echo -e "${CROSS} Unsupported OS detected. Exiting."
exit 1 exit 238
fi fi
# ============================================================================== # ==============================================================================
@@ -207,7 +207,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "Pihole-Exporter is not installed. Nothing to update." msg_error "Pihole-Exporter is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -32,7 +32,7 @@ AUTH_TOKEN_FILE="/etc/prometheus-paperless-ngx-exporter/paperless_auth_token_fil
# ============================================================================== # ==============================================================================
if ! grep -qE 'ID=debian|ID=ubuntu' /etc/os-release 2>/dev/null; then if ! grep -qE 'ID=debian|ID=ubuntu' /etc/os-release 2>/dev/null; then
echo -e "${CROSS} Unsupported OS detected. This script only supports Debian and Ubuntu." echo -e "${CROSS} Unsupported OS detected. This script only supports Debian and Ubuntu."
exit 1 exit 238
fi fi
# ============================================================================== # ==============================================================================
@@ -144,7 +144,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "Prometheus-Paperless-NGX-Exporter is not installed. Nothing to update." msg_error "Prometheus-Paperless-NGX-Exporter is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -41,7 +41,7 @@ elif grep -qE 'ID=debian|ID=ubuntu' /etc/os-release; then
SERVICE_PATH="/etc/systemd/system/qbittorrent-exporter.service" SERVICE_PATH="/etc/systemd/system/qbittorrent-exporter.service"
else else
echo -e "${CROSS} Unsupported OS detected. Exiting." echo -e "${CROSS} Unsupported OS detected. Exiting."
exit 1 exit 238
fi fi
# ============================================================================== # ==============================================================================
@@ -200,7 +200,7 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "qBittorrent-Exporter is not installed. Nothing to update." msg_error "qBittorrent-Exporter is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi

View File

@@ -62,7 +62,7 @@ function check_or_install_docker() {
msg_ok "Docker Compose is available" msg_ok "Docker Compose is available"
else else
msg_error "Docker Compose plugin is not available. Please install it." msg_error "Docker Compose plugin is not available. Please install it."
exit 1 exit 10
fi fi
return return
fi fi
@@ -72,7 +72,7 @@ function check_or_install_docker() {
read -r install_docker_prompt read -r install_docker_prompt
if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then if [[ ! "${install_docker_prompt,,}" =~ ^(y|yes)$ ]]; then
msg_error "Docker is required for ${APP}. Exiting." msg_error "Docker is required for ${APP}. Exiting."
exit 1 exit 10
fi fi
msg_info "Installing Docker" msg_info "Installing Docker"
@@ -168,14 +168,14 @@ if [[ "${type:-}" == "update" ]]; then
update update
else else
msg_error "${APP} is not installed. Nothing to update." msg_error "${APP} is not installed. Nothing to update."
exit 1 exit 233
fi fi
exit 0 exit 0
fi fi
if [[ -f /etc/alpine-release ]]; then if [[ -f /etc/alpine-release ]]; then
msg_error "${APP} does not support Alpine Linux. Please use a Debian or Ubuntu based LXC." msg_error "${APP} does not support Alpine Linux. Please use a Debian or Ubuntu based LXC."
exit 1 exit 238
fi fi
header_info header_info

View File

@@ -62,7 +62,7 @@ function msg_error() {
} }
if [ -z "$(ls -A /var/lib/docker/volumes/hass_config/_data/backups/)" ]; then if [ -z "$(ls -A /var/lib/docker/volumes/hass_config/_data/backups/)" ]; then
msg_error "No backups found! \n" msg_error "No backups found! \n"
exit 1 exit 235
fi fi
DIR=/var/lib/docker/volumes/hass_config/_data/restore DIR=/var/lib/docker/volumes/hass_config/_data/restore
if [ -d "$DIR" ]; then if [ -d "$DIR" ]; then

View File

@@ -62,7 +62,7 @@ function msg_error() {
} }
if [ -z "$(ls -A /root/.homeassistant/backups/)" ]; then if [ -z "$(ls -A /root/.homeassistant/backups/)" ]; then
msg_error "No backups found! \n" msg_error "No backups found! \n"
exit 1 exit 235
fi fi
DIR=/root/.homeassistant/restore DIR=/root/.homeassistant/restore
if [ -d "$DIR" ]; then if [ -d "$DIR" ]; then

View File

@@ -39,7 +39,7 @@ ROOT_FS=$(df -Th "/" | awk 'NR==2 {print $2}')
if [ "$ROOT_FS" != "ext4" ]; then if [ "$ROOT_FS" != "ext4" ]; then
whiptail --backtitle "Proxmox VE Helper Scripts" \ whiptail --backtitle "Proxmox VE Helper Scripts" \
--title "Warning" \ --title "Warning" \
--yesno "Root filesystem is not ext4 ($ROOT_FS).\nContinue anyway?" 12 80 || exit 1 --yesno "Root filesystem is not ext4 ($ROOT_FS).\nContinue anyway?" 12 80 || exit 0
fi fi
NODE=$(hostname) NODE=$(hostname)

View File

@@ -57,7 +57,7 @@ done
if [ ${#kernels_to_remove[@]} -eq 0 ]; then if [ ${#kernels_to_remove[@]} -eq 0 ]; then
echo -e "${RD}No valid selection made. Exiting.${CL}" echo -e "${RD}No valid selection made. Exiting.${CL}"
exit 1 exit 0
fi fi
# Confirm removal # Confirm removal
@@ -66,7 +66,7 @@ printf "%s\n" "${kernels_to_remove[@]}"
read -rp "Proceed with removal? (y/n): " confirm read -rp "Proceed with removal? (y/n): " confirm
if [[ "$confirm" != "y" ]]; then if [[ "$confirm" != "y" ]]; then
echo -e "${RD}Aborted.${CL}" echo -e "${RD}Aborted.${CL}"
exit 1 exit 0
fi fi
# Remove kernels # Remove kernels

View File

@@ -51,7 +51,7 @@ containers=$(pct list | tail -n +2 | awk '{print $0 " " $4}')
if [ -z "$containers" ]; then if [ -z "$containers" ]; then
whiptail --title "LXC Container Delete" --msgbox "No LXC containers available!" 10 60 whiptail --title "LXC Container Delete" --msgbox "No LXC containers available!" 10 60
exit 1 exit 234
fi fi
menu_items=("ALL" "Delete ALL containers" "OFF") # Add as first option menu_items=("ALL" "Delete ALL containers" "OFF") # Add as first option
@@ -72,7 +72,7 @@ CHOICES=$(whiptail --title "LXC Container Delete" \
if [ -z "$CHOICES" ]; then if [ -z "$CHOICES" ]; then
whiptail --title "LXC Container Delete" \ whiptail --title "LXC Container Delete" \
--msgbox "No containers selected!" 10 60 --msgbox "No containers selected!" 10 60
exit 1 exit 0
fi fi
read -p "Delete containers manually or automatically? (Default: manual) m/a: " DELETE_MODE read -p "Delete containers manually or automatically? (Default: manual) m/a: " DELETE_MODE

View File

@@ -47,7 +47,7 @@ function msg_warn() { echo -e "${WARN} ${YWB}${1}"; }
# Check for root privileges # Check for root privileges
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
msg_error "Error: This script must be run as root." msg_error "Error: This script must be run as root."
exit 1 exit 104
fi fi
if ! command -v ethtool >/dev/null 2>&1; then if ! command -v ethtool >/dev/null 2>&1; then
@@ -55,7 +55,7 @@ if ! command -v ethtool >/dev/null 2>&1; then
apt-get update &>/dev/null apt-get update &>/dev/null
apt-get install -y ethtool &>/dev/null || { apt-get install -y ethtool &>/dev/null || {
msg_error "Failed to install ethtool. Exiting." msg_error "Failed to install ethtool. Exiting."
exit 1 exit 237
} }
msg_ok "ethtool installed successfully" msg_ok "ethtool installed successfully"
fi fi
@@ -86,7 +86,7 @@ done
if [ ${#INTERFACES[@]} -eq 0 ]; then if [ ${#INTERFACES[@]} -eq 0 ]; then
whiptail --title "Error" --msgbox "No Intel e1000e or e1000 network interfaces found!" 10 60 whiptail --title "Error" --msgbox "No Intel e1000e or e1000 network interfaces found!" 10 60
msg_error "No Intel e1000e or e1000 network interfaces found! Exiting." msg_error "No Intel e1000e or e1000 network interfaces found! Exiting."
exit 1 exit 236
fi fi
msg_ok "Found ${BL}$COUNT${GN} Intel e1000e/e1000 interfaces" msg_ok "Found ${BL}$COUNT${GN} Intel e1000e/e1000 interfaces"

View File

@@ -41,7 +41,7 @@ header_info
virt=$(systemd-detect-virt) virt=$(systemd-detect-virt)
if [ "$virt" != "none" ]; then if [ "$virt" != "none" ]; then
msg_error "This script must be run on bare metal. Detected virtual environment: $virt" msg_error "This script must be run on bare metal. Detected virtual environment: $virt"
exit 1 exit 232
fi fi
# Attempt to obtain the current loaded microcode revision # Attempt to obtain the current loaded microcode revision

View File

@@ -83,7 +83,7 @@ main() {
if command -v pveversion >/dev/null 2>&1; then if command -v pveversion >/dev/null 2>&1; then
echo -e "\n🛑 PVE Detected, Wrong Script!\n" echo -e "\n🛑 PVE Detected, Wrong Script!\n"
exit 1 exit 232
fi fi
local CODENAME local CODENAME
@@ -95,7 +95,7 @@ main() {
*) *)
msg_error "Unsupported Debian codename: $CODENAME" msg_error "Unsupported Debian codename: $CODENAME"
echo -e "Supported: bookworm (PBS 3.x) and trixie (PBS 4.x)" echo -e "Supported: bookworm (PBS 3.x) and trixie (PBS 4.x)"
exit 1 exit 105
;; ;;
esac esac
} }

View File

@@ -49,7 +49,7 @@ declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "post-pmg-inst
if ! grep -q "Proxmox Mail Gateway" /etc/issue 2>/dev/null; then if ! grep -q "Proxmox Mail Gateway" /etc/issue 2>/dev/null; then
msg_error "This script is only intended for Proxmox Mail Gateway" msg_error "This script is only intended for Proxmox Mail Gateway"
exit 1 exit 232
fi fi
repo_state() { repo_state() {

View File

@@ -88,19 +88,19 @@ main() {
if [[ "$PVE_MAJOR" == "8" ]]; then if [[ "$PVE_MAJOR" == "8" ]]; then
if ((PVE_MINOR < 0 || PVE_MINOR > 9)); then if ((PVE_MINOR < 0 || PVE_MINOR > 9)); then
msg_error "Unsupported Proxmox 8 version" msg_error "Unsupported Proxmox 8 version"
exit 1 exit 105
fi fi
start_routines_8 start_routines_8
elif [[ "$PVE_MAJOR" == "9" ]]; then elif [[ "$PVE_MAJOR" == "9" ]]; then
if ((PVE_MINOR < 0 || PVE_MINOR > 1)); then if ((PVE_MINOR < 0 || PVE_MINOR > 1)); then
msg_error "Only Proxmox 9.0-9.1.x is currently supported" msg_error "Only Proxmox 9.0-9.1.x is currently supported"
exit 1 exit 105
fi fi
start_routines_9 start_routines_9
else else
msg_error "Unsupported Proxmox VE major version: $PVE_MAJOR" msg_error "Unsupported Proxmox VE major version: $PVE_MAJOR"
echo -e "Supported: 8.08.9.x and 9.09.1.x" echo -e "Supported: 8.08.9.x and 9.09.1.x"
exit 1 exit 105
fi fi
} }

View File

@@ -25,7 +25,7 @@ header_info "$APP"
check_root() { check_root() {
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then
msg_error "Script must be run as root" msg_error "Script must be run as root"
exit 1 exit 104
fi fi
} }
@@ -63,7 +63,7 @@ select_container() {
if [[ ${#lxc_list[@]} -eq 0 ]]; then if [[ ${#lxc_list[@]} -eq 0 ]]; then
msg_error "No containers found" msg_error "No containers found"
exit 1 exit 234
fi fi
PS3="Enter number of container to convert: " PS3="Enter number of container to convert: "
@@ -101,7 +101,7 @@ backup_container() {
if [ -z "$BACKUP_PATH" ] || ! grep -q "Backup job finished successfully" "$vzdump_output"; then if [ -z "$BACKUP_PATH" ] || ! grep -q "Backup job finished successfully" "$vzdump_output"; then
rm "$vzdump_output" rm "$vzdump_output"
msg_error "Backup failed" msg_error "Backup failed"
exit 1 exit 235
fi fi
rm "$vzdump_output" rm "$vzdump_output"
msg_ok "Backup complete: $BACKUP_PATH" msg_ok "Backup complete: $BACKUP_PATH"
@@ -126,7 +126,7 @@ perform_conversion() {
msg_ok "Conversion successful" msg_ok "Conversion successful"
else else
msg_error "Conversion failed" msg_error "Conversion failed"
exit 1 exit 235
fi fi
} }

View File

@@ -140,7 +140,7 @@ function backup_container() {
msg_ok "Backup created" msg_ok "Backup created"
else else
msg_error "Backup failed for container $1" msg_error "Backup failed for container $1"
exit 1 exit 235
fi fi
} }
@@ -183,7 +183,7 @@ containers=$(pct list | tail -n +2 | awk '{print $0 " " $4}')
if [ -z "$containers" ]; then if [ -z "$containers" ]; then
whiptail --title "LXC Container Update" --msgbox "No LXC containers available!" 10 60 whiptail --title "LXC Container Update" --msgbox "No LXC containers available!" 10 60
exit 1 exit 234
fi fi
menu_items=() menu_items=()
@@ -242,7 +242,7 @@ if [[ -n "$var_container" ]]; then
if [[ -z "$CHOICE" ]]; then if [[ -z "$CHOICE" ]]; then
msg_error "No containers matched the selection criteria: $var_container ${var_tags:-community-script|proxmox-helper-scripts}" msg_error "No containers matched the selection criteria: $var_container ${var_tags:-community-script|proxmox-helper-scripts}"
exit 1 exit 234
fi fi
msg_ok "Selected containers: $CHOICE" msg_ok "Selected containers: $CHOICE"
else else
@@ -253,7 +253,7 @@ else
if [ -z "$CHOICE" ]; then if [ -z "$CHOICE" ]; then
whiptail --title "LXC Container Update" \ whiptail --title "LXC Container Update" \
--msgbox "No containers selected!" 10 60 --msgbox "No containers selected!" 10 60
exit 1 exit 0
fi fi
fi fi
@@ -284,7 +284,7 @@ if [ "$BACKUP_CHOICE" == "yes" ]; then
if [ -z "$STORAGES" ]; then if [ -z "$STORAGES" ]; then
msg_error "No storage with 'backup' support found!" msg_error "No storage with 'backup' support found!"
exit 1 exit 119
fi fi
# Determine storage based on var_backup_storage # Determine storage based on var_backup_storage
@@ -296,7 +296,7 @@ if [ "$BACKUP_CHOICE" == "yes" ]; then
else else
msg_error "Specified backup storage '$var_backup_storage' not found or doesn't support backups!" msg_error "Specified backup storage '$var_backup_storage' not found or doesn't support backups!"
msg_info "Available storages: $(echo $STORAGES | tr '\n' ' ')" msg_info "Available storages: $(echo $STORAGES | tr '\n' ' ')"
exit 1 exit 119
fi fi
else else
MENU_ITEMS=() MENU_ITEMS=()
@@ -308,7 +308,7 @@ if [ "$BACKUP_CHOICE" == "yes" ]; then
if [ -z "$STORAGE_CHOICE" ]; then if [ -z "$STORAGE_CHOICE" ]; then
msg_error "No storage selected!" msg_error "No storage selected!"
exit 1 exit 0
fi fi
fi fi
fi fi
@@ -436,11 +436,11 @@ for container in $CHOICE; do
msg_ok "Restored LXC from backup" msg_ok "Restored LXC from backup"
else else
msg_error "Restored LXC from backup failed" msg_error "Restored LXC from backup failed"
exit 1 exit 235
fi fi
else else
msg_error "Update failed for container $container. Exiting" msg_error "Update failed for container $container. Exiting"
exit 1 exit "$exit_code"
fi fi
done done

View File

@@ -158,7 +158,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -169,7 +169,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -177,7 +177,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {
@@ -513,7 +513,7 @@ DISK_REF_IMPORTED="$(printf '%s\n' "$IMPORT_OUT" | sed -n "s/.*successfully impo
[[ -z "$DISK_REF_IMPORTED" ]] && { [[ -z "$DISK_REF_IMPORTED" ]] && {
msg_error "Unable to determine imported disk reference." msg_error "Unable to determine imported disk reference."
echo "$IMPORT_OUT" echo "$IMPORT_OUT"
exit 1 exit 226
} }
msg_ok "Imported disk (${CL}${BL}${DISK_REF_IMPORTED}${CL})" msg_ok "Imported disk (${CL}${BL}${DISK_REF_IMPORTED}${CL})"

View File

@@ -158,7 +158,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -169,7 +169,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -177,7 +177,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {

View File

@@ -158,7 +158,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -169,7 +169,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -177,7 +177,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {

View File

@@ -638,7 +638,7 @@ DISK_REF_IMPORTED="$(printf '%s\n' "$IMPORT_OUT" | sed -n "s/.*successfully impo
[[ -z "$DISK_REF_IMPORTED" ]] && { [[ -z "$DISK_REF_IMPORTED" ]] && {
msg_error "Unable to determine imported disk reference." msg_error "Unable to determine imported disk reference."
echo "$IMPORT_OUT" echo "$IMPORT_OUT"
exit 1 exit 226
} }
msg_ok "Imported disk (${CL}${BL}${DISK_REF_IMPORTED}${CL})" msg_ok "Imported disk (${CL}${BL}${DISK_REF_IMPORTED}${CL})"

View File

@@ -163,7 +163,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -174,7 +174,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -182,7 +182,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {
@@ -221,7 +221,7 @@ function ensure_pv() {
if ! apt-get update -qq &>/dev/null || ! apt-get install -y pv &>/dev/null; then if ! apt-get update -qq &>/dev/null || ! apt-get install -y pv &>/dev/null; then
msg_error "Failed to install pv automatically." msg_error "Failed to install pv automatically."
echo -e "\nPlease run manually on the Proxmox host:\n apt install pv\n" echo -e "\nPlease run manually on the Proxmox host:\n apt install pv\n"
exit 1 exit 237
fi fi
msg_ok "Installed pv" msg_ok "Installed pv"
fi fi
@@ -249,14 +249,14 @@ function download_and_validate_xz() {
if ! curl -fSL -o "$file" "$url"; then if ! curl -fSL -o "$file" "$url"; then
msg_error "Download failed: $url" msg_error "Download failed: $url"
rm -f "$file" rm -f "$file"
exit 1 exit 115
fi fi
# Validate again # Validate again
if ! xz -t "$file" &>/dev/null; then if ! xz -t "$file" &>/dev/null; then
msg_error "Downloaded file $(basename "$file") is corrupted. Please try again later." msg_error "Downloaded file $(basename "$file") is corrupted. Please try again later."
rm -f "$file" rm -f "$file"
exit 1 exit 115
fi fi
msg_ok "Downloaded and validated $(basename "$file")" msg_ok "Downloaded and validated $(basename "$file")"
} }
@@ -272,7 +272,7 @@ function extract_xz_with_pv() {
if ! xz -dc "$file" | pv -N "Extracting" >"$target"; then if ! xz -dc "$file" | pv -N "Extracting" >"$target"; then
msg_error "Failed to extract $file" msg_error "Failed to extract $file"
rm -f "$target" rm -f "$target"
exit 1 exit 115
fi fi
msg_ok "Decompressed to $target" msg_ok "Decompressed to $target"
} }
@@ -592,7 +592,7 @@ DISK_REF="$(printf '%s\n' "$IMPORT_OUT" | sed -n "s/.*successfully imported disk
[[ -z "$DISK_REF" ]] && { [[ -z "$DISK_REF" ]] && {
msg_error "Unable to determine imported disk reference." msg_error "Unable to determine imported disk reference."
echo "$IMPORT_OUT" echo "$IMPORT_OUT"
exit 1 exit 226
} }
msg_ok "Imported disk (${CL}${BL}${DISK_REF}${CL})" msg_ok "Imported disk (${CL}${BL}${DISK_REF}${CL})"

View File

@@ -159,7 +159,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -170,7 +170,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -178,7 +178,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {

View File

@@ -158,7 +158,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -169,7 +169,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -177,7 +177,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {

View File

@@ -226,7 +226,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -237,7 +237,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -245,7 +245,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {
@@ -556,7 +556,7 @@ fi
if [[ -z "$DISK_REF" ]]; then if [[ -z "$DISK_REF" ]]; then
msg_error "Unable to determine imported disk reference." msg_error "Unable to determine imported disk reference."
echo "$IMPORT_OUT" echo "$IMPORT_OUT"
exit 1 exit 226
fi fi
qm set $VMID \ qm set $VMID \
@@ -635,7 +635,7 @@ if qm status "$VMID" | grep -q "running"; then
msg_ok "Network interfaces configured in OpenWrt" msg_ok "Network interfaces configured in OpenWrt"
else else
msg_error "VM is not running" msg_error "VM is not running"
exit 1 exit 226
fi fi
msg_info "Waiting for OpenWrt to shut down..." msg_info "Waiting for OpenWrt to shut down..."

View File

@@ -210,7 +210,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -221,7 +221,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -229,7 +229,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {
@@ -616,7 +616,7 @@ for ver in $RELEASE_LIST; do
done done
if [ -z "$URL" ]; then if [ -z "$URL" ]; then
msg_error "Could not find generic FreeBSD amd64 qcow2 image (non-UFS/ZFS)." msg_error "Could not find generic FreeBSD amd64 qcow2 image (non-UFS/ZFS)."
exit 1 exit 115
fi fi
msg_ok "Download URL: ${CL}${BL}${URL}${CL}" msg_ok "Download URL: ${CL}${BL}${URL}${CL}"
@@ -626,7 +626,7 @@ if ! check_disk_space "$TEMP_DIR" 20; then
msg_error "Insufficient disk space in temporary directory ($TEMP_DIR)." msg_error "Insufficient disk space in temporary directory ($TEMP_DIR)."
msg_error "Available: ${AVAILABLE_GB}, Required: ~20GB for FreeBSD image decompression." msg_error "Available: ${AVAILABLE_GB}, Required: ~20GB for FreeBSD image decompression."
msg_error "Please free up space or ensure /tmp has sufficient storage." msg_error "Please free up space or ensure /tmp has sufficient storage."
exit 1 exit 214
fi fi
msg_info "Downloading FreeBSD Image" msg_info "Downloading FreeBSD Image"
@@ -639,7 +639,7 @@ if ! check_disk_space "$TEMP_DIR" 15; then
AVAILABLE_GB=$(df -h "$TEMP_DIR" | awk 'NR==2 {print $4}') AVAILABLE_GB=$(df -h "$TEMP_DIR" | awk 'NR==2 {print $4}')
msg_error "Insufficient disk space for decompression." msg_error "Insufficient disk space for decompression."
msg_error "Available: ${AVAILABLE_GB}, Required: ~15GB for decompressed image." msg_error "Available: ${AVAILABLE_GB}, Required: ~15GB for decompressed image."
exit 1 exit 214
fi fi
msg_info "Decompressing FreeBSD Image (this may take a few minutes)" msg_info "Decompressing FreeBSD Image (this may take a few minutes)"
@@ -648,7 +648,7 @@ if ! unxz -cv $(basename $URL) >${FILE}; then
msg_error "Failed to decompress FreeBSD image." msg_error "Failed to decompress FreeBSD image."
msg_error "This is usually caused by insufficient disk space." msg_error "This is usually caused by insufficient disk space."
df -h "$TEMP_DIR" df -h "$TEMP_DIR"
exit 1 exit 115
fi fi
# Remove the compressed file to save space # Remove the compressed file to save space

View File

@@ -159,7 +159,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -170,7 +170,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -178,7 +178,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {

View File

@@ -167,7 +167,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -178,7 +178,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -186,7 +186,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {

View File

@@ -192,7 +192,7 @@ function pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -202,14 +202,14 @@ function pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not yet supported." msg_error "This version of Proxmox VE is not yet supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {
@@ -305,7 +305,7 @@ function advanced_settings() {
if [ $ISO_COUNT -eq 0 ]; then if [ $ISO_COUNT -eq 0 ]; then
echo "No ISOs found." echo "No ISOs found."
exit 1 exit 115
fi fi
# Identify the index of the last stable release # Identify the index of the last stable release
@@ -529,7 +529,7 @@ if [ -z "${SELECTED_ISO:-}" ]; then
if [ -z "$SELECTED_ISO" ]; then if [ -z "$SELECTED_ISO" ]; then
msg_error "Could not find a stable ISO for fallback." msg_error "Could not find a stable ISO for fallback."
exit 1 exit 115
fi fi
fi fi

View File

@@ -155,7 +155,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -166,7 +166,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -174,7 +174,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {

View File

@@ -158,7 +158,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -169,7 +169,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -177,7 +177,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {

View File

@@ -157,7 +157,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -168,7 +168,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -176,7 +176,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {

View File

@@ -157,7 +157,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 9)); then if ((MINOR < 0 || MINOR > 9)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 8.0 8.9" msg_error "Supported: Proxmox VE version 8.0 8.9"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -168,7 +168,7 @@ pve_check() {
if ((MINOR < 0 || MINOR > 1)); then if ((MINOR < 0 || MINOR > 1)); then
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported: Proxmox VE version 9.0 9.1" msg_error "Supported: Proxmox VE version 9.0 9.1"
exit 1 exit 105
fi fi
return 0 return 0
fi fi
@@ -176,7 +176,7 @@ pve_check() {
# All other unsupported versions # All other unsupported versions
msg_error "This version of Proxmox VE is not supported." msg_error "This version of Proxmox VE is not supported."
msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1" msg_error "Supported versions: Proxmox VE 8.0 8.x or 9.0 9.1"
exit 1 exit 105
} }
function arch_check() { function arch_check() {
@@ -215,7 +215,7 @@ function ensure_pv() {
if ! apt-get update -qq &>/dev/null || ! apt-get install -y pv &>/dev/null; then if ! apt-get update -qq &>/dev/null || ! apt-get install -y pv &>/dev/null; then
msg_error "Failed to install pv automatically." msg_error "Failed to install pv automatically."
echo -e "\nPlease run manually on the Proxmox host:\n apt install pv\n" echo -e "\nPlease run manually on the Proxmox host:\n apt install pv\n"
exit 1 exit 237
fi fi
msg_ok "Installed pv" msg_ok "Installed pv"
fi fi
@@ -243,14 +243,14 @@ function download_and_validate_xz() {
if ! curl -fSL -o "$file" "$url"; then if ! curl -fSL -o "$file" "$url"; then
msg_error "Download failed: $url" msg_error "Download failed: $url"
rm -f "$file" rm -f "$file"
exit 1 exit 115
fi fi
# Validate again # Validate again
if ! xz -t "$file" &>/dev/null; then if ! xz -t "$file" &>/dev/null; then
msg_error "Downloaded file $(basename "$file") is corrupted. Please try again later." msg_error "Downloaded file $(basename "$file") is corrupted. Please try again later."
rm -f "$file" rm -f "$file"
exit 1 exit 115
fi fi
msg_ok "Downloaded and validated $(basename "$file")" msg_ok "Downloaded and validated $(basename "$file")"
} }
@@ -266,7 +266,7 @@ function extract_xz_with_pv() {
if ! xz -dc "$file" | pv -N "Extracting" >"$target"; then if ! xz -dc "$file" | pv -N "Extracting" >"$target"; then
msg_error "Failed to extract $file" msg_error "Failed to extract $file"
rm -f "$target" rm -f "$target"
exit 1 exit 115
fi fi
msg_ok "Decompressed to $target" msg_ok "Decompressed to $target"
} }
@@ -514,7 +514,7 @@ done < <(pvesm status -content images | awk 'NR>1 {printf "%s %s %s\n", $1, $2,
if [ ${#STORAGE_MENU[@]} -eq 0 ]; then if [ ${#STORAGE_MENU[@]} -eq 0 ]; then
msg_error "Unable to detect a valid storage location." msg_error "Unable to detect a valid storage location."
exit 1 exit 119
elif [ $((${#STORAGE_MENU[@]} / 3)) -eq 1 ]; then elif [ $((${#STORAGE_MENU[@]} / 3)) -eq 1 ]; then
STORAGE=${STORAGE_MENU[0]} STORAGE=${STORAGE_MENU[0]}
else else