mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-19 11:35:55 +01:00
Compare commits
5 Commits
add-script
...
vm_error_h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e90150f88 | ||
|
|
a99bbb4e49 | ||
|
|
e089d60d9e | ||
|
|
2bd4b063d9 | ||
|
|
40bd7dc366 |
@@ -414,6 +414,7 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
|||||||
|
|
||||||
- #### 🐞 Bug Fixes
|
- #### 🐞 Bug Fixes
|
||||||
|
|
||||||
|
- Tududi: Fix sed command for DB_FILE configuration [@tremor021](https://github.com/tremor021) ([#11988](https://github.com/community-scripts/ProxmoxVE/pull/11988))
|
||||||
- slskd: fix exit position [@MickLesk](https://github.com/MickLesk) ([#11963](https://github.com/community-scripts/ProxmoxVE/pull/11963))
|
- slskd: fix exit position [@MickLesk](https://github.com/MickLesk) ([#11963](https://github.com/community-scripts/ProxmoxVE/pull/11963))
|
||||||
- cryptpad: restore config earlier and run onlyoffice upgrade [@MickLesk](https://github.com/MickLesk) ([#11964](https://github.com/community-scripts/ProxmoxVE/pull/11964))
|
- cryptpad: restore config earlier and run onlyoffice upgrade [@MickLesk](https://github.com/MickLesk) ([#11964](https://github.com/community-scripts/ProxmoxVE/pull/11964))
|
||||||
- jellyseerr/overseerr: Migrate update script to Seerr; prompt rerun [@MickLesk](https://github.com/MickLesk) ([#11965](https://github.com/community-scripts/ProxmoxVE/pull/11965))
|
- jellyseerr/overseerr: Migrate update script to Seerr; prompt rerun [@MickLesk](https://github.com/MickLesk) ([#11965](https://github.com/community-scripts/ProxmoxVE/pull/11965))
|
||||||
@@ -441,12 +442,9 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
|||||||
|
|
||||||
- #### 📝 Script Information
|
- #### 📝 Script Information
|
||||||
|
|
||||||
|
- Update Wishlist LXC webpage to include reverse proxy info [@summoningpixels](https://github.com/summoningpixels) ([#11973](https://github.com/community-scripts/ProxmoxVE/pull/11973))
|
||||||
- Update OpenCloud LXC webpage to include services ports [@summoningpixels](https://github.com/summoningpixels) ([#11969](https://github.com/community-scripts/ProxmoxVE/pull/11969))
|
- Update OpenCloud LXC webpage to include services ports [@summoningpixels](https://github.com/summoningpixels) ([#11969](https://github.com/community-scripts/ProxmoxVE/pull/11969))
|
||||||
|
|
||||||
### ❔ Uncategorized
|
|
||||||
|
|
||||||
- Update Wishlist LXC webpage to include reverse proxy info [@summoningpixels](https://github.com/summoningpixels) ([#11973](https://github.com/community-scripts/ProxmoxVE/pull/11973))
|
|
||||||
|
|
||||||
## 2026-02-15
|
## 2026-02-15
|
||||||
|
|
||||||
### 🆕 New Scripts
|
### 🆕 New Scripts
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
____ __ ___
|
|
||||||
/ __ \____ ____ ___ / |/ /
|
|
||||||
/ /_/ / __ \/ __ `__ \/ /|_/ /
|
|
||||||
/ _, _/ /_/ / / / / / / / / /
|
|
||||||
/_/ |_|\____/_/ /_/ /_/_/ /_/
|
|
||||||
|
|
||||||
74
ct/romm.sh
74
ct/romm.sh
@@ -1,74 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
|
||||||
# Copyright (c) 2021-2026 community-scripts ORG
|
|
||||||
# Author: MickLesk (CanbiZ) | DevelopmentCats | AlphaLawless
|
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
||||||
# Source: https://romm.app
|
|
||||||
|
|
||||||
APP="RomM"
|
|
||||||
var_tags="${var_tags:-emulation}"
|
|
||||||
var_cpu="${var_cpu:-2}"
|
|
||||||
var_ram="${var_ram:-4096}"
|
|
||||||
var_disk="${var_disk:-20}"
|
|
||||||
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/romm ]]; then
|
|
||||||
msg_error "No ${APP} Installation Found!"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if check_for_gh_release "romm" "rommapp/romm"; then
|
|
||||||
msg_info "Stopping Services"
|
|
||||||
systemctl stop romm-backend romm-worker romm-scheduler romm-watcher
|
|
||||||
msg_ok "Stopped Services"
|
|
||||||
|
|
||||||
msg_info "Backing up configuration"
|
|
||||||
cp /opt/romm/.env /opt/romm/.env.backup
|
|
||||||
msg_ok "Backed up configuration"
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "romm" "rommapp/romm" "tarball" "latest" "/opt/romm"
|
|
||||||
|
|
||||||
msg_info "Updating ROMM"
|
|
||||||
cp /opt/romm/.env.backup /opt/romm/.env
|
|
||||||
cd /opt/romm
|
|
||||||
$STD uv sync --all-extras
|
|
||||||
cd /opt/romm/backend
|
|
||||||
$STD uv run alembic upgrade head
|
|
||||||
cd /opt/romm/frontend
|
|
||||||
$STD npm install
|
|
||||||
$STD npm run build
|
|
||||||
# Merge static assets into dist folder
|
|
||||||
cp -rf /opt/romm/frontend/assets/* /opt/romm/frontend/dist/assets/
|
|
||||||
mkdir -p /opt/romm/frontend/dist/assets/romm
|
|
||||||
ln -sfn /var/lib/romm/resources /opt/romm/frontend/dist/assets/romm/resources
|
|
||||||
ln -sfn /var/lib/romm/assets /opt/romm/frontend/dist/assets/romm/assets
|
|
||||||
msg_ok "Updated ROMM"
|
|
||||||
|
|
||||||
msg_info "Starting Services"
|
|
||||||
systemctl start romm-backend romm-worker romm-scheduler romm-watcher
|
|
||||||
msg_ok "Started Services"
|
|
||||||
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}${CL}"
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "RomM",
|
|
||||||
"slug": "romm",
|
|
||||||
"categories": [
|
|
||||||
24
|
|
||||||
],
|
|
||||||
"date_created": "2025-03-10",
|
|
||||||
"type": "ct",
|
|
||||||
"updateable": true,
|
|
||||||
"privileged": false,
|
|
||||||
"interface_port": 80,
|
|
||||||
"documentation": "https://docs.romm.app/latest/",
|
|
||||||
"website": "https://romm.app/",
|
|
||||||
"config_path": "/opt/romm/.env",
|
|
||||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/romm.webp",
|
|
||||||
"description": "RomM (ROM Manager) allows you to scan, enrich, browse and play your game collection with a clean and responsive interface. Support for multiple platforms, various naming schemes, and custom tags.",
|
|
||||||
"install_methods": [
|
|
||||||
{
|
|
||||||
"type": "default",
|
|
||||||
"script": "ct/romm.sh",
|
|
||||||
"resources": {
|
|
||||||
"cpu": 2,
|
|
||||||
"ram": 4096,
|
|
||||||
"hdd": 20,
|
|
||||||
"os": "debian",
|
|
||||||
"version": "13"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_credentials": {
|
|
||||||
"username": null,
|
|
||||||
"password": null
|
|
||||||
},
|
|
||||||
"notes": []
|
|
||||||
}
|
|
||||||
@@ -1,344 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Copyright (c) 2021-2026 community-scripts ORG
|
|
||||||
# Author: MickLesk (CanbiZ) | DevelopmentCats | AlphaLawless
|
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
||||||
# Source: https://romm.app
|
|
||||||
|
|
||||||
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 \
|
|
||||||
acl \
|
|
||||||
git \
|
|
||||||
build-essential \
|
|
||||||
libssl-dev \
|
|
||||||
libffi-dev \
|
|
||||||
libmagic-dev \
|
|
||||||
python3-dev \
|
|
||||||
python3-pip \
|
|
||||||
python3-venv \
|
|
||||||
libmariadb3 \
|
|
||||||
libmariadb-dev \
|
|
||||||
libpq-dev \
|
|
||||||
libbz2-dev \
|
|
||||||
libreadline-dev \
|
|
||||||
libsqlite3-dev \
|
|
||||||
zlib1g-dev \
|
|
||||||
liblzma-dev \
|
|
||||||
libncurses5-dev \
|
|
||||||
libncursesw5-dev \
|
|
||||||
redis-server \
|
|
||||||
redis-tools \
|
|
||||||
p7zip-full \
|
|
||||||
tzdata \
|
|
||||||
nginx
|
|
||||||
msg_ok "Installed Dependencies"
|
|
||||||
|
|
||||||
PYTHON_VERSION="3.13" setup_uv
|
|
||||||
NODE_VERSION="22" setup_nodejs
|
|
||||||
setup_mariadb
|
|
||||||
MARIADB_DB_NAME="romm" MARIADB_DB_USER="romm" setup_mariadb_db
|
|
||||||
|
|
||||||
msg_info "Creating directories"
|
|
||||||
mkdir -p /opt/romm \
|
|
||||||
/var/lib/romm/config \
|
|
||||||
/var/lib/romm/resources \
|
|
||||||
/var/lib/romm/assets/{saves,states,screenshots} \
|
|
||||||
/var/lib/romm/library/roms \
|
|
||||||
/var/lib/romm/library/bios
|
|
||||||
msg_ok "Created directories"
|
|
||||||
|
|
||||||
msg_info "Creating configuration file"
|
|
||||||
cat <<'EOF' >/var/lib/romm/config/config.yml
|
|
||||||
# RomM Configuration File
|
|
||||||
# Documentation: https://docs.romm.app/latest/Getting-Started/Configuration-File/
|
|
||||||
# Only uncomment the lines you want to use/modify
|
|
||||||
|
|
||||||
# exclude:
|
|
||||||
# platforms:
|
|
||||||
# - excluded_folder_a
|
|
||||||
# roms:
|
|
||||||
# single_file:
|
|
||||||
# extensions:
|
|
||||||
# - xml
|
|
||||||
# - txt
|
|
||||||
# names:
|
|
||||||
# - '._*'
|
|
||||||
# - '*.nfo'
|
|
||||||
# multi_file:
|
|
||||||
# names:
|
|
||||||
# - downloaded_media
|
|
||||||
# - media
|
|
||||||
|
|
||||||
# system:
|
|
||||||
# platforms:
|
|
||||||
# gc: ngc
|
|
||||||
# ps1: psx
|
|
||||||
|
|
||||||
# The folder name where your roms are located (relative to library path)
|
|
||||||
# filesystem:
|
|
||||||
# roms_folder: 'roms'
|
|
||||||
|
|
||||||
# scan:
|
|
||||||
# priority:
|
|
||||||
# metadata:
|
|
||||||
# - "igdb"
|
|
||||||
# - "moby"
|
|
||||||
# - "ss"
|
|
||||||
# - "ra"
|
|
||||||
# artwork:
|
|
||||||
# - "igdb"
|
|
||||||
# - "moby"
|
|
||||||
# - "ss"
|
|
||||||
# region:
|
|
||||||
# - "us"
|
|
||||||
# - "eu"
|
|
||||||
# - "jp"
|
|
||||||
# language:
|
|
||||||
# - "en"
|
|
||||||
# media:
|
|
||||||
# - box2d
|
|
||||||
# - box3d
|
|
||||||
# - screenshot
|
|
||||||
# - manual
|
|
||||||
|
|
||||||
# emulatorjs:
|
|
||||||
# debug: false
|
|
||||||
# cache_limit: null
|
|
||||||
EOF
|
|
||||||
chmod 644 /var/lib/romm/config/config.yml
|
|
||||||
msg_ok "Created configuration file"
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "RAHasher" "RetroAchievements/RALibretro" "prebuild" "latest" "/opt/RALibretro" "RAHasher-x64-Linux-*.zip"
|
|
||||||
cp /opt/RALibretro/RAHasher /usr/bin/RAHasher
|
|
||||||
chmod +x /usr/bin/RAHasher
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "romm" "rommapp/romm"
|
|
||||||
|
|
||||||
msg_info "Creating environment file"
|
|
||||||
sed -i 's/^supervised no/supervised systemd/' /etc/redis/redis.conf
|
|
||||||
systemctl restart redis-server
|
|
||||||
systemctl enable -q --now redis-server
|
|
||||||
AUTH_SECRET_KEY=$(openssl rand -hex 32)
|
|
||||||
|
|
||||||
cat <<EOF >/opt/romm/.env
|
|
||||||
ROMM_BASE_PATH=/var/lib/romm
|
|
||||||
ROMM_CONFIG_PATH=/var/lib/romm/config/config.yml
|
|
||||||
WEB_CONCURRENCY=4
|
|
||||||
|
|
||||||
DB_HOST=127.0.0.1
|
|
||||||
DB_PORT=3306
|
|
||||||
DB_NAME=$MARIADB_DB_NAME
|
|
||||||
DB_USER=$MARIADB_DB_USER
|
|
||||||
DB_PASSWD=$MARIADB_DB_PASS
|
|
||||||
|
|
||||||
REDIS_HOST=127.0.0.1
|
|
||||||
REDIS_PORT=6379
|
|
||||||
|
|
||||||
ROMM_AUTH_SECRET_KEY=$AUTH_SECRET_KEY
|
|
||||||
DISABLE_DOWNLOAD_ENDPOINT_AUTH=false
|
|
||||||
DISABLE_CSRF_PROTECTION=false
|
|
||||||
|
|
||||||
ENABLE_RESCAN_ON_FILESYSTEM_CHANGE=true
|
|
||||||
RESCAN_ON_FILESYSTEM_CHANGE_DELAY=5
|
|
||||||
|
|
||||||
ENABLE_SCHEDULED_RESCAN=true
|
|
||||||
SCHEDULED_RESCAN_CRON=0 3 * * *
|
|
||||||
ENABLE_SCHEDULED_UPDATE_SWITCH_TITLEDB=true
|
|
||||||
SCHEDULED_UPDATE_SWITCH_TITLEDB_CRON=0 4 * * *
|
|
||||||
|
|
||||||
LOGLEVEL=INFO
|
|
||||||
EOF
|
|
||||||
|
|
||||||
chmod 600 /opt/romm/.env
|
|
||||||
msg_ok "Created environment file"
|
|
||||||
|
|
||||||
msg_info "Setting up RomM Backend"
|
|
||||||
cd /opt/romm
|
|
||||||
export UV_CONCURRENT_DOWNLOADS=1
|
|
||||||
$STD uv sync --all-extras
|
|
||||||
cd /opt/romm/backend
|
|
||||||
$STD uv run alembic upgrade head
|
|
||||||
msg_ok "Set up RomM Backend"
|
|
||||||
|
|
||||||
msg_info "Setting up RomM Frontend"
|
|
||||||
cd /opt/romm/frontend
|
|
||||||
$STD npm install
|
|
||||||
$STD npm run build
|
|
||||||
|
|
||||||
cp -rf /opt/romm/frontend/assets/* /opt/romm/frontend/dist/assets/
|
|
||||||
|
|
||||||
mkdir -p /opt/romm/frontend/dist/assets/romm
|
|
||||||
ln -sfn /var/lib/romm/resources /opt/romm/frontend/dist/assets/romm/resources
|
|
||||||
ln -sfn /var/lib/romm/assets /opt/romm/frontend/dist/assets/romm/assets
|
|
||||||
msg_ok "Set up RomM Frontend"
|
|
||||||
|
|
||||||
msg_info "Configuring Nginx"
|
|
||||||
cat <<'EOF' >/etc/nginx/sites-available/romm
|
|
||||||
upstream romm_backend {
|
|
||||||
server 127.0.0.1:5000;
|
|
||||||
}
|
|
||||||
|
|
||||||
map $http_upgrade $connection_upgrade {
|
|
||||||
default upgrade;
|
|
||||||
'' close;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name _;
|
|
||||||
root /opt/romm/frontend/dist;
|
|
||||||
client_max_body_size 0;
|
|
||||||
|
|
||||||
# Frontend SPA
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Static assets
|
|
||||||
location /assets {
|
|
||||||
alias /opt/romm/frontend/dist/assets;
|
|
||||||
try_files $uri $uri/ =404;
|
|
||||||
expires 1y;
|
|
||||||
add_header Cache-Control "public, immutable";
|
|
||||||
}
|
|
||||||
|
|
||||||
# EmulatorJS player - requires COOP/COEP headers for SharedArrayBuffer
|
|
||||||
location ~ ^/rom/.*/ejs$ {
|
|
||||||
add_header Cross-Origin-Embedder-Policy "require-corp";
|
|
||||||
add_header Cross-Origin-Opener-Policy "same-origin";
|
|
||||||
try_files $uri /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Backend API
|
|
||||||
location /api {
|
|
||||||
proxy_pass http://romm_backend;
|
|
||||||
proxy_buffering off;
|
|
||||||
proxy_request_buffering off;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
# WebSocket and Netplay
|
|
||||||
location ~ ^/(ws|netplay) {
|
|
||||||
proxy_pass http://romm_backend;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection $connection_upgrade;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_read_timeout 86400;
|
|
||||||
}
|
|
||||||
|
|
||||||
# OpenAPI docs
|
|
||||||
location = /openapi.json {
|
|
||||||
proxy_pass http://romm_backend;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Internal library file serving
|
|
||||||
location /library/ {
|
|
||||||
internal;
|
|
||||||
alias /var/lib/romm/library/;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
rm -f /etc/nginx/sites-enabled/default
|
|
||||||
ln -sf /etc/nginx/sites-available/romm /etc/nginx/sites-enabled/romm
|
|
||||||
systemctl restart nginx
|
|
||||||
systemctl enable -q --now nginx
|
|
||||||
msg_ok "Configured Nginx"
|
|
||||||
|
|
||||||
msg_info "Creating Services"
|
|
||||||
cat <<EOF >/etc/systemd/system/romm-backend.service
|
|
||||||
[Unit]
|
|
||||||
Description=RomM Backend
|
|
||||||
After=network.target mariadb.service redis-server.service
|
|
||||||
Requires=mariadb.service redis-server.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
WorkingDirectory=/opt/romm/backend
|
|
||||||
EnvironmentFile=/opt/romm/.env
|
|
||||||
Environment="PYTHONPATH=/opt/romm"
|
|
||||||
ExecStart=/opt/romm/.venv/bin/python main.py
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=5
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF >/etc/systemd/system/romm-worker.service
|
|
||||||
[Unit]
|
|
||||||
Description=RomM RQ Worker
|
|
||||||
After=network.target mariadb.service redis-server.service romm-backend.service
|
|
||||||
Requires=mariadb.service redis-server.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
WorkingDirectory=/opt/romm/backend
|
|
||||||
EnvironmentFile=/opt/romm/.env
|
|
||||||
Environment="PYTHONPATH=/opt/romm/backend"
|
|
||||||
ExecStart=/opt/romm/.venv/bin/rq worker --path /opt/romm/backend --url redis://127.0.0.1:6379/0 high default low
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=5
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF >/etc/systemd/system/romm-scheduler.service
|
|
||||||
[Unit]
|
|
||||||
Description=RomM RQ Scheduler
|
|
||||||
After=network.target mariadb.service redis-server.service romm-backend.service
|
|
||||||
Requires=mariadb.service redis-server.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
WorkingDirectory=/opt/romm/backend
|
|
||||||
EnvironmentFile=/opt/romm/.env
|
|
||||||
Environment="PYTHONPATH=/opt/romm/backend"
|
|
||||||
Environment="RQ_REDIS_HOST=127.0.0.1"
|
|
||||||
Environment="RQ_REDIS_PORT=6379"
|
|
||||||
ExecStart=/opt/romm/.venv/bin/rqscheduler --path /opt/romm/backend
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=5
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF >/etc/systemd/system/romm-watcher.service
|
|
||||||
[Unit]
|
|
||||||
Description=RomM Filesystem Watcher
|
|
||||||
After=network.target romm-backend.service
|
|
||||||
Requires=romm-backend.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
WorkingDirectory=/opt/romm/backend
|
|
||||||
EnvironmentFile=/opt/romm/.env
|
|
||||||
Environment="PYTHONPATH=/opt/romm/backend"
|
|
||||||
ExecStart=/opt/romm/.venv/bin/watchfiles --target-type command '/opt/romm/.venv/bin/python watcher.py' /var/lib/romm/library
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=5
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
|
|
||||||
systemctl enable -q --now romm-backend romm-worker romm-scheduler romm-watcher
|
|
||||||
msg_ok "Created Services"
|
|
||||||
|
|
||||||
motd_ssh
|
|
||||||
customize
|
|
||||||
cleanup_lxc
|
|
||||||
@@ -38,8 +38,8 @@ SECRET="$(openssl rand -hex 64)"
|
|||||||
sed -e '/^NODE_ENV=/s/=.*$/=production/' \
|
sed -e '/^NODE_ENV=/s/=.*$/=production/' \
|
||||||
-e 's/^TUDUDI_USER/# TUDUDI_USER/g' \
|
-e 's/^TUDUDI_USER/# TUDUDI_USER/g' \
|
||||||
-e "/_SECRET=/s/=.*$/=${SECRET}/" \
|
-e "/_SECRET=/s/=.*$/=${SECRET}/" \
|
||||||
-e "/^# DB_FILE/s/^# //; \
|
-e '/^# DB_FILE=/s/^# //' \
|
||||||
\|DB_FILE|s|/path.*$|${DB_LOCATION}/production.sqlite3|" \
|
-e "s|^DB_FILE=.*|DB_FILE=${DB_LOCATION}/production.sqlite3|" \
|
||||||
-e "/^# TUDUDI_ALLOWED/s/^# //; \
|
-e "/^# TUDUDI_ALLOWED/s/^# //; \
|
||||||
\|_ORIGINS=|s|=.*$|=<your tududi IP or FDQN>|" \
|
\|_ORIGINS=|s|=.*$|=<your tududi IP or FDQN>|" \
|
||||||
-e "/^# TUDUDI_UPLOAD/s/^# //; \
|
-e "/^# TUDUDI_UPLOAD/s/^# //; \
|
||||||
|
|||||||
@@ -135,19 +135,44 @@ explain_exit_code() {
|
|||||||
# --- Generic / Shell ---
|
# --- Generic / Shell ---
|
||||||
1) echo "General error / Operation not permitted" ;;
|
1) echo "General error / Operation not permitted" ;;
|
||||||
2) echo "Misuse of shell builtins (e.g. syntax error)" ;;
|
2) echo "Misuse of shell builtins (e.g. syntax error)" ;;
|
||||||
|
10) echo "Docker / privileged mode required (unsupported environment)" ;;
|
||||||
|
|
||||||
# --- curl / wget errors (commonly seen in downloads) ---
|
# --- curl / wget errors (commonly seen in downloads) ---
|
||||||
|
4) echo "curl: Feature not supported or protocol error" ;;
|
||||||
|
5) echo "curl: Could not resolve proxy" ;;
|
||||||
6) echo "curl: DNS resolution failed (could not resolve host)" ;;
|
6) echo "curl: DNS resolution failed (could not resolve host)" ;;
|
||||||
7) echo "curl: Failed to connect (network unreachable / host down)" ;;
|
7) echo "curl: Failed to connect (network unreachable / host down)" ;;
|
||||||
|
8) echo "curl: FTP server reply error" ;;
|
||||||
22) echo "curl: HTTP error returned (404, 429, 500+)" ;;
|
22) echo "curl: HTTP error returned (404, 429, 500+)" ;;
|
||||||
|
23) echo "curl: Write error (disk full or permissions)" ;;
|
||||||
|
25) echo "curl: Upload failed" ;;
|
||||||
28) echo "curl: Operation timeout (network slow or server not responding)" ;;
|
28) echo "curl: Operation timeout (network slow or server not responding)" ;;
|
||||||
|
30) echo "curl: FTP port command failed" ;;
|
||||||
35) echo "curl: SSL/TLS handshake failed (certificate error)" ;;
|
35) echo "curl: SSL/TLS handshake failed (certificate error)" ;;
|
||||||
|
56) echo "curl: Receive error (connection reset by peer)" ;;
|
||||||
|
75) echo "Temporary failure (retry later)" ;;
|
||||||
|
78) echo "curl: Remote file not found (404 on FTP/file)" ;;
|
||||||
|
|
||||||
# --- Package manager / APT / DPKG ---
|
# --- Package manager / APT / DPKG ---
|
||||||
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)" ;;
|
||||||
|
|
||||||
|
# --- BSD sysexits.h (64-78) ---
|
||||||
|
64) echo "Usage error (wrong arguments)" ;;
|
||||||
|
65) echo "Data format error (bad input data)" ;;
|
||||||
|
66) echo "Input file not found (cannot open input)" ;;
|
||||||
|
67) echo "User not found (addressee unknown)" ;;
|
||||||
|
68) echo "Host not found (hostname unknown)" ;;
|
||||||
|
69) echo "Service unavailable" ;;
|
||||||
|
70) echo "Internal software error" ;;
|
||||||
|
71) echo "System error (OS-level failure)" ;;
|
||||||
|
72) echo "Critical OS file missing" ;;
|
||||||
|
73) echo "Cannot create output file" ;;
|
||||||
|
74) echo "I/O error" ;;
|
||||||
|
76) echo "Remote protocol error" ;;
|
||||||
|
77) echo "Permission denied" ;;
|
||||||
|
|
||||||
# --- Common shell/system errors ---
|
# --- Common shell/system errors ---
|
||||||
124) echo "Command timed out (timeout command)" ;;
|
124) echo "Command timed out (timeout command)" ;;
|
||||||
126) echo "Command invoked cannot execute (permission problem?)" ;;
|
126) echo "Command invoked cannot execute (permission problem?)" ;;
|
||||||
@@ -624,6 +649,8 @@ EOF
|
|||||||
curl -fsS -m "${TELEMETRY_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
curl -fsS -m "${TELEMETRY_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "$JSON_PAYLOAD" &>/dev/null || true
|
-d "$JSON_PAYLOAD" &>/dev/null || true
|
||||||
|
|
||||||
|
POST_TO_API_DONE=true
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -5253,14 +5253,20 @@ ensure_log_on_host() {
|
|||||||
# - Exit trap handler for reporting to API telemetry
|
# - Exit trap handler for reporting to API telemetry
|
||||||
# - Captures exit code and reports to PocketBase using centralized error descriptions
|
# - Captures exit code and reports to PocketBase using centralized error descriptions
|
||||||
# - Uses explain_exit_code() from api.func for consistent error messages
|
# - Uses explain_exit_code() from api.func for consistent error messages
|
||||||
# - Posts failure status with exit code to API (error description resolved automatically)
|
# - For non-zero exit codes: posts "failed" status
|
||||||
# - Only executes on non-zero exit codes
|
# - For zero exit codes where post_update_to_api was never called:
|
||||||
|
# catches orphaned "installing" records (e.g., script exited cleanly
|
||||||
|
# but description() was never reached)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
api_exit_script() {
|
api_exit_script() {
|
||||||
exit_code=$?
|
local exit_code=$?
|
||||||
if [ $exit_code -ne 0 ]; then
|
if [ $exit_code -ne 0 ]; then
|
||||||
ensure_log_on_host
|
ensure_log_on_host
|
||||||
post_update_to_api "failed" "$exit_code"
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
elif [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
# Script exited with 0 but never sent a completion status
|
||||||
|
# This catches edge cases like early returns after post_to_api()
|
||||||
|
post_update_to_api "failed" "1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,11 +37,34 @@ if ! declare -f explain_exit_code &>/dev/null; then
|
|||||||
case "$code" in
|
case "$code" in
|
||||||
1) echo "General error / Operation not permitted" ;;
|
1) echo "General error / Operation not permitted" ;;
|
||||||
2) echo "Misuse of shell builtins (e.g. syntax error)" ;;
|
2) echo "Misuse of shell builtins (e.g. syntax error)" ;;
|
||||||
|
10) echo "Docker / privileged mode required (unsupported environment)" ;;
|
||||||
|
4) echo "curl: Feature not supported or protocol error" ;;
|
||||||
|
5) echo "curl: Could not resolve proxy" ;;
|
||||||
6) echo "curl: DNS resolution failed (could not resolve host)" ;;
|
6) echo "curl: DNS resolution failed (could not resolve host)" ;;
|
||||||
7) echo "curl: Failed to connect (network unreachable / host down)" ;;
|
7) echo "curl: Failed to connect (network unreachable / host down)" ;;
|
||||||
|
8) echo "curl: FTP server reply error" ;;
|
||||||
22) echo "curl: HTTP error returned (404, 429, 500+)" ;;
|
22) echo "curl: HTTP error returned (404, 429, 500+)" ;;
|
||||||
|
23) echo "curl: Write error (disk full or permissions)" ;;
|
||||||
|
25) echo "curl: Upload failed" ;;
|
||||||
28) echo "curl: Operation timeout (network slow or server not responding)" ;;
|
28) echo "curl: Operation timeout (network slow or server not responding)" ;;
|
||||||
|
30) echo "curl: FTP port command failed" ;;
|
||||||
35) echo "curl: SSL/TLS handshake failed (certificate error)" ;;
|
35) echo "curl: SSL/TLS handshake failed (certificate error)" ;;
|
||||||
|
56) echo "curl: Receive error (connection reset by peer)" ;;
|
||||||
|
75) echo "Temporary failure (retry later)" ;;
|
||||||
|
78) echo "curl: Remote file not found (404 on FTP/file)" ;;
|
||||||
|
64) echo "Usage error (wrong arguments)" ;;
|
||||||
|
65) echo "Data format error (bad input data)" ;;
|
||||||
|
66) echo "Input file not found (cannot open input)" ;;
|
||||||
|
67) echo "User not found (addressee unknown)" ;;
|
||||||
|
68) echo "Host not found (hostname unknown)" ;;
|
||||||
|
69) echo "Service unavailable" ;;
|
||||||
|
70) echo "Internal software error" ;;
|
||||||
|
71) echo "System error (OS-level failure)" ;;
|
||||||
|
72) echo "Critical OS file missing" ;;
|
||||||
|
73) echo "Cannot create output file" ;;
|
||||||
|
74) echo "I/O error" ;;
|
||||||
|
76) echo "Remote protocol error" ;;
|
||||||
|
77) echo "Permission denied" ;;
|
||||||
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)" ;;
|
||||||
|
|||||||
@@ -529,9 +529,21 @@ cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
if [[ "$(dirs -p | wc -l)" -gt 1 ]]; then
|
if [[ "$(dirs -p | wc -l)" -gt 1 ]]; then
|
||||||
popd >/dev/null || true
|
popd >/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
# Report final telemetry status if post_to_api_vm was called but no update was sent
|
||||||
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if declare -f post_update_to_api >/dev/null 2>&1; then
|
||||||
|
if [[ $exit_code -ne 0 ]]; then
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
else
|
||||||
|
# Exited cleanly but description()/success was never called — shouldn't happen
|
||||||
|
post_update_to_api "failed" "1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_root() {
|
check_root() {
|
||||||
|
|||||||
@@ -100,8 +100,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,8 +104,16 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
# Only send telemetry if post_to_api_vm was called (installing status was sent)
|
||||||
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,8 +101,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,8 +79,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,8 +101,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,8 +109,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,15 @@ function cleanup_vmid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
local exit_code=$?
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
post_update_to_api "done" "none"
|
if [[ "${POST_TO_API_DONE:-}" == "true" && "${POST_UPDATE_DONE:-}" != "true" ]]; then
|
||||||
|
if [[ $exit_code -eq 0 ]]; then
|
||||||
|
post_update_to_api "done" "none"
|
||||||
|
else
|
||||||
|
post_update_to_api "failed" "$exit_code"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $TEMP_DIR
|
rm -rf $TEMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user