mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-18 19:15:55 +01:00
Compare commits
11 Commits
feature/to
...
feature/sm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f30db9cc3 | ||
|
|
2d7e707a00 | ||
|
|
ccccd8abca | ||
|
|
f463bd5029 | ||
|
|
eef38514b1 | ||
|
|
03f5cd9de5 | ||
|
|
9c03b34e7d | ||
|
|
28c19a79d3 | ||
|
|
8e4d5b1d28 | ||
|
|
e731b9fb65 | ||
|
|
93cb6f99fe |
30
CHANGELOG.md
30
CHANGELOG.md
@@ -404,34 +404,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
</details>
|
||||
|
||||
## 2026-02-17
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
- Databasus ([#12018](https://github.com/community-scripts/ProxmoxVE/pull/12018))
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- fix: pterodactyl-panel add symlink [@CrazyWolf13](https://github.com/CrazyWolf13) ([#11997](https://github.com/community-scripts/ProxmoxVE/pull/11997))
|
||||
|
||||
### 💾 Core
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- core: call get_lxc_ip in start() before updates [@MickLesk](https://github.com/MickLesk) ([#12015](https://github.com/community-scripts/ProxmoxVE/pull/12015))
|
||||
|
||||
- #### ✨ New Features
|
||||
|
||||
- core: smart recovery for failed installs | extend exit_codes [@MickLesk](https://github.com/MickLesk) ([#11221](https://github.com/community-scripts/ProxmoxVE/pull/11221))
|
||||
|
||||
### 🧰 Tools
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
- Immich Public Proxy: centralize and fix systemd service creation [@MickLesk](https://github.com/MickLesk) ([#12025](https://github.com/community-scripts/ProxmoxVE/pull/12025))
|
||||
|
||||
## 2026-02-16
|
||||
|
||||
### 🆕 New Scripts
|
||||
@@ -441,8 +413,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Opencloud: Pin version to 5.1.0 [@vhsdream](https://github.com/vhsdream) ([#12004](https://github.com/community-scripts/ProxmoxVE/pull/12004))
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- Tududi: Fix sed command for DB_FILE configuration [@tremor021](https://github.com/tremor021) ([#11988](https://github.com/community-scripts/ProxmoxVE/pull/11988))
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
#!/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: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/databasus/databasus
|
||||
|
||||
APP="Databasus"
|
||||
var_tags="${var_tags:-backup;postgresql;database}"
|
||||
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 [[ ! -f /opt/databasus/databasus ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "databasus" "databasus/databasus"; then
|
||||
msg_info "Stopping Databasus"
|
||||
$STD systemctl stop databasus
|
||||
msg_ok "Stopped Databasus"
|
||||
|
||||
msg_info "Backing up Configuration"
|
||||
cp /opt/databasus/.env /opt/databasus.env.bak
|
||||
msg_ok "Backed up Configuration"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "databasus" "databasus/databasus" "tarball" "latest" "/opt/databasus"
|
||||
|
||||
msg_info "Updating Databasus"
|
||||
cd /opt/databasus/frontend
|
||||
$STD npm ci
|
||||
$STD npm run build
|
||||
cd /opt/databasus/backend
|
||||
$STD go mod download
|
||||
$STD /root/go/bin/swag init -g cmd/main.go -o swagger
|
||||
$STD env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o databasus ./cmd/main.go
|
||||
mv /opt/databasus/backend/databasus /opt/databasus/databasus
|
||||
cp -r /opt/databasus/frontend/dist/* /opt/databasus/ui/build/
|
||||
cp -r /opt/databasus/backend/migrations /opt/databasus/
|
||||
chown -R postgres:postgres /opt/databasus
|
||||
msg_ok "Updated Databasus"
|
||||
|
||||
msg_info "Restoring Configuration"
|
||||
cp /opt/databasus.env.bak /opt/databasus/.env
|
||||
rm -f /opt/databasus.env.bak
|
||||
chown postgres:postgres /opt/databasus/.env
|
||||
msg_ok "Restored Configuration"
|
||||
|
||||
msg_info "Starting Databasus"
|
||||
$STD systemctl start databasus
|
||||
msg_ok "Started Databasus"
|
||||
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,6 +0,0 @@
|
||||
____ __ __
|
||||
/ __ \____ _/ /_____ _/ /_ ____ ________ _______
|
||||
/ / / / __ `/ __/ __ `/ __ \/ __ `/ ___/ / / / ___/
|
||||
/ /_/ / /_/ / /_/ /_/ / /_/ / /_/ (__ ) /_/ (__ )
|
||||
/_____/\__,_/\__/\__,_/_.___/\__,_/____/\__,_/____/
|
||||
|
||||
@@ -29,7 +29,7 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
RELEASE="v5.1.0"
|
||||
RELEASE="v5.0.2"
|
||||
if check_for_gh_release "OpenCloud" "opencloud-eu/opencloud" "${RELEASE}"; then
|
||||
msg_info "Stopping services"
|
||||
systemctl stop opencloud opencloud-wopi
|
||||
|
||||
@@ -71,7 +71,6 @@ EOF
|
||||
$STD php artisan migrate --seed --force --no-interaction
|
||||
chown -R www-data:www-data /opt/pterodactyl-panel/*
|
||||
chmod -R 755 /opt/pterodactyl-panel/storage /opt/pterodactyl-panel/bootstrap/cache/
|
||||
ln -s /opt/pterodactyl-panel /var/www/pterodactyl
|
||||
rm -rf "/opt/pterodactyl-panel/panel.tar.gz"
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Updated $APP to v${RELEASE}"
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "Databasus",
|
||||
"slug": "databasus",
|
||||
"categories": [
|
||||
7
|
||||
],
|
||||
"date_created": "2026-02-17",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 80,
|
||||
"documentation": "https://github.com/databasus/databasus",
|
||||
"website": "https://github.com/databasus/databasus",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/databasus.webp",
|
||||
"config_path": "/opt/databasus/.env",
|
||||
"description": "Free, open source and self-hosted solution for automated PostgreSQL backups. With multiple storage options, notifications, scheduling, and a beautiful web interface for managing database backups across multiple PostgreSQL instances.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/databasus.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 8,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": "admin@localhost",
|
||||
"password": "See /root/databasus.creds"
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Supports PostgreSQL versions 12-18 with cloud and self-hosted instances",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Features: Scheduled backups, multiple storage providers, notifications, encryption",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"generated": "2026-02-17T06:22:06Z",
|
||||
"generated": "2026-02-16T12:14:16Z",
|
||||
"versions": [
|
||||
{
|
||||
"slug": "2fauth",
|
||||
@@ -193,9 +193,9 @@
|
||||
{
|
||||
"slug": "cleanuparr",
|
||||
"repo": "Cleanuparr/Cleanuparr",
|
||||
"version": "v2.6.3",
|
||||
"version": "v2.6.2",
|
||||
"pinned": false,
|
||||
"date": "2026-02-16T22:41:25Z"
|
||||
"date": "2026-02-15T02:15:19Z"
|
||||
},
|
||||
{
|
||||
"slug": "cloudreve",
|
||||
@@ -557,9 +557,9 @@
|
||||
{
|
||||
"slug": "immich-public-proxy",
|
||||
"repo": "alangrainger/immich-public-proxy",
|
||||
"version": "v1.15.3",
|
||||
"version": "v1.15.2",
|
||||
"pinned": false,
|
||||
"date": "2026-02-16T22:54:27Z"
|
||||
"date": "2026-02-16T08:54:59Z"
|
||||
},
|
||||
{
|
||||
"slug": "inspircd",
|
||||
@@ -578,16 +578,16 @@
|
||||
{
|
||||
"slug": "invoiceninja",
|
||||
"repo": "invoiceninja/invoiceninja",
|
||||
"version": "v5.12.62",
|
||||
"version": "v5.12.60",
|
||||
"pinned": false,
|
||||
"date": "2026-02-17T03:23:48Z"
|
||||
"date": "2026-02-15T00:11:31Z"
|
||||
},
|
||||
{
|
||||
"slug": "jackett",
|
||||
"repo": "Jackett/Jackett",
|
||||
"version": "v0.24.1140",
|
||||
"version": "v0.24.1127",
|
||||
"pinned": false,
|
||||
"date": "2026-02-17T05:54:25Z"
|
||||
"date": "2026-02-16T08:43:41Z"
|
||||
},
|
||||
{
|
||||
"slug": "jellystat",
|
||||
@@ -704,9 +704,9 @@
|
||||
{
|
||||
"slug": "librenms",
|
||||
"repo": "librenms/librenms",
|
||||
"version": "26.2.0",
|
||||
"version": "26.1.1",
|
||||
"pinned": false,
|
||||
"date": "2026-02-16T12:15:13Z"
|
||||
"date": "2026-01-12T23:26:02Z"
|
||||
},
|
||||
{
|
||||
"slug": "librespeed-rust",
|
||||
@@ -739,9 +739,9 @@
|
||||
{
|
||||
"slug": "linkstack",
|
||||
"repo": "linkstackorg/linkstack",
|
||||
"version": "v4.8.4",
|
||||
"version": "v4.8.5",
|
||||
"pinned": false,
|
||||
"date": "2024-12-10T15:14:34Z"
|
||||
"date": "2026-01-26T18:46:52Z"
|
||||
},
|
||||
{
|
||||
"slug": "linkwarden",
|
||||
@@ -802,9 +802,9 @@
|
||||
{
|
||||
"slug": "mealie",
|
||||
"repo": "mealie-recipes/mealie",
|
||||
"version": "v3.11.0",
|
||||
"version": "v3.10.2",
|
||||
"pinned": false,
|
||||
"date": "2026-02-17T04:13:35Z"
|
||||
"date": "2026-02-04T23:32:32Z"
|
||||
},
|
||||
{
|
||||
"slug": "mediamanager",
|
||||
@@ -956,9 +956,9 @@
|
||||
{
|
||||
"slug": "opencloud",
|
||||
"repo": "opencloud-eu/opencloud",
|
||||
"version": "v5.1.0",
|
||||
"version": "v5.0.2",
|
||||
"pinned": true,
|
||||
"date": "2026-02-16T15:04:28Z"
|
||||
"date": "2026-02-05T16:29:01Z"
|
||||
},
|
||||
{
|
||||
"slug": "opengist",
|
||||
@@ -1026,16 +1026,16 @@
|
||||
{
|
||||
"slug": "paperless-ngx",
|
||||
"repo": "paperless-ngx/paperless-ngx",
|
||||
"version": "v2.20.7",
|
||||
"version": "v2.20.6",
|
||||
"pinned": false,
|
||||
"date": "2026-02-16T16:52:23Z"
|
||||
"date": "2026-01-31T07:30:27Z"
|
||||
},
|
||||
{
|
||||
"slug": "patchmon",
|
||||
"repo": "PatchMon/PatchMon",
|
||||
"version": "v1.4.1",
|
||||
"version": "v1.4.0",
|
||||
"pinned": false,
|
||||
"date": "2026-02-16T18:00:13Z"
|
||||
"date": "2026-02-13T10:39:03Z"
|
||||
},
|
||||
{
|
||||
"slug": "paymenter",
|
||||
@@ -1362,9 +1362,9 @@
|
||||
{
|
||||
"slug": "slskd",
|
||||
"repo": "slskd/slskd",
|
||||
"version": "0.24.4",
|
||||
"version": "0.24.3",
|
||||
"pinned": false,
|
||||
"date": "2026-02-16T16:50:17Z"
|
||||
"date": "2026-01-15T14:40:15Z"
|
||||
},
|
||||
{
|
||||
"slug": "snipeit",
|
||||
@@ -1411,9 +1411,9 @@
|
||||
{
|
||||
"slug": "stirling-pdf",
|
||||
"repo": "Stirling-Tools/Stirling-PDF",
|
||||
"version": "v2.5.0",
|
||||
"version": "v2.4.6",
|
||||
"pinned": false,
|
||||
"date": "2026-02-16T22:58:17Z"
|
||||
"date": "2026-02-12T00:01:19Z"
|
||||
},
|
||||
{
|
||||
"slug": "streamlink-webui",
|
||||
@@ -1544,9 +1544,9 @@
|
||||
{
|
||||
"slug": "tunarr",
|
||||
"repo": "chrisbenincasa/tunarr",
|
||||
"version": "v1.1.13",
|
||||
"version": "v1.1.12",
|
||||
"pinned": false,
|
||||
"date": "2026-02-16T16:16:17Z"
|
||||
"date": "2026-02-03T20:19:00Z"
|
||||
},
|
||||
{
|
||||
"slug": "uhf",
|
||||
@@ -1628,9 +1628,9 @@
|
||||
{
|
||||
"slug": "wanderer",
|
||||
"repo": "meilisearch/meilisearch",
|
||||
"version": "v1.35.1",
|
||||
"version": "v1.35.0",
|
||||
"pinned": false,
|
||||
"date": "2026-02-16T17:01:17Z"
|
||||
"date": "2026-02-02T09:57:03Z"
|
||||
},
|
||||
{
|
||||
"slug": "warracker",
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/databasus/databasus
|
||||
|
||||
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 \
|
||||
nginx \
|
||||
valkey
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PG_VERSION="17" setup_postgresql
|
||||
setup_go
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
|
||||
fetch_and_deploy_gh_release "databasus" "databasus/databasus" "tarball" "latest" "/opt/databasus"
|
||||
|
||||
msg_info "Building Databasus (Patience)"
|
||||
cd /opt/databasus/frontend
|
||||
$STD npm ci
|
||||
$STD npm run build
|
||||
cd /opt/databasus/backend
|
||||
$STD go mod tidy
|
||||
$STD go mod download
|
||||
$STD go install github.com/swaggo/swag/cmd/swag@latest
|
||||
$STD /root/go/bin/swag init -g cmd/main.go -o swagger
|
||||
$STD env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o databasus ./cmd/main.go
|
||||
mv /opt/databasus/backend/databasus /opt/databasus/databasus
|
||||
mkdir -p /databasus-data/{pgdata,temp,backups,data,logs}
|
||||
mkdir -p /opt/databasus/ui/build
|
||||
mkdir -p /opt/databasus/migrations
|
||||
cp -r /opt/databasus/frontend/dist/* /opt/databasus/ui/build/
|
||||
cp -r /opt/databasus/backend/migrations/* /opt/databasus/migrations/
|
||||
chown -R postgres:postgres /databasus-data
|
||||
msg_ok "Built Databasus"
|
||||
|
||||
msg_info "Configuring Databasus"
|
||||
JWT_SECRET=$(openssl rand -hex 32)
|
||||
ENCRYPTION_KEY=$(openssl rand -hex 32)
|
||||
# Create PostgreSQL version symlinks for compatibility
|
||||
for v in 12 13 14 15 16 18; do
|
||||
ln -sf /usr/lib/postgresql/17 /usr/lib/postgresql/$v
|
||||
done
|
||||
# Install goose for migrations
|
||||
$STD go install github.com/pressly/goose/v3/cmd/goose@latest
|
||||
ln -sf /root/go/bin/goose /usr/local/bin/goose
|
||||
cat <<EOF >/opt/databasus/.env
|
||||
# Environment
|
||||
ENV_MODE=production
|
||||
|
||||
# Server
|
||||
SERVER_PORT=4005
|
||||
SERVER_HOST=0.0.0.0
|
||||
|
||||
# Database
|
||||
DATABASE_DSN=host=localhost user=postgres password=postgres dbname=databasus port=5432 sslmode=disable
|
||||
DATABASE_URL=postgres://postgres:postgres@localhost:5432/databasus?sslmode=disable
|
||||
|
||||
# Migrations
|
||||
GOOSE_DRIVER=postgres
|
||||
GOOSE_DBSTRING=postgres://postgres:postgres@localhost:5432/databasus?sslmode=disable
|
||||
GOOSE_MIGRATION_DIR=/opt/databasus/migrations
|
||||
|
||||
# Valkey (Redis-compatible cache)
|
||||
VALKEY_HOST=localhost
|
||||
VALKEY_PORT=6379
|
||||
|
||||
# Security
|
||||
JWT_SECRET=${JWT_SECRET}
|
||||
ENCRYPTION_KEY=${ENCRYPTION_KEY}
|
||||
|
||||
# Paths
|
||||
DATA_DIR=/databasus-data/data
|
||||
BACKUP_DIR=/databasus-data/backups
|
||||
LOG_DIR=/databasus-data/logs
|
||||
EOF
|
||||
chown postgres:postgres /opt/databasus/.env
|
||||
chmod 600 /opt/databasus/.env
|
||||
msg_ok "Configured Databasus"
|
||||
|
||||
msg_info "Configuring Valkey"
|
||||
cat <<EOF >/etc/valkey/valkey.conf
|
||||
port 6379
|
||||
bind 127.0.0.1
|
||||
protected-mode yes
|
||||
save ""
|
||||
maxmemory 256mb
|
||||
maxmemory-policy allkeys-lru
|
||||
EOF
|
||||
systemctl enable -q --now valkey-server
|
||||
systemctl restart valkey-server
|
||||
msg_ok "Configured Valkey"
|
||||
|
||||
msg_info "Creating Database"
|
||||
# Configure PostgreSQL to allow local password auth for databasus
|
||||
PG_HBA="/etc/postgresql/17/main/pg_hba.conf"
|
||||
if ! grep -q "databasus" "$PG_HBA"; then
|
||||
sed -i '/^local\s*all\s*all/i local databasus postgres trust' "$PG_HBA"
|
||||
sed -i '/^host\s*all\s*all\s*127/i host databasus postgres 127.0.0.1/32 trust' "$PG_HBA"
|
||||
systemctl reload postgresql
|
||||
fi
|
||||
$STD sudo -u postgres psql -c "CREATE DATABASE databasus;" 2>/dev/null || true
|
||||
$STD sudo -u postgres psql -c "ALTER USER postgres WITH SUPERUSER CREATEROLE CREATEDB;" 2>/dev/null || true
|
||||
msg_ok "Created Database"
|
||||
|
||||
msg_info "Creating Databasus Service"
|
||||
cat <<EOF >/etc/systemd/system/databasus.service
|
||||
[Unit]
|
||||
Description=Databasus - Database Backup Management
|
||||
After=network.target postgresql.service valkey.service
|
||||
Requires=postgresql.service valkey.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/databasus
|
||||
EnvironmentFile=/opt/databasus/.env
|
||||
ExecStart=/opt/databasus/databasus
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
$STD systemctl daemon-reload
|
||||
$STD systemctl enable -q --now databasus
|
||||
msg_ok "Created Databasus Service"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
cat <<EOF >/etc/nginx/sites-available/databasus
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:4005;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
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;
|
||||
proxy_cache_bypass \$http_upgrade;
|
||||
proxy_buffering off;
|
||||
proxy_read_timeout 86400s;
|
||||
proxy_send_timeout 86400s;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
ln -sf /etc/nginx/sites-available/databasus /etc/nginx/sites-enabled/databasus
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
$STD nginx -t
|
||||
$STD systemctl enable -q --now nginx
|
||||
$STD systemctl reload nginx
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -64,7 +64,7 @@ $STD sudo -u cool coolconfig set-admin-password --user=admin --password="$COOLPA
|
||||
echo "$COOLPASS" >~/.coolpass
|
||||
msg_ok "Installed Collabora Online"
|
||||
|
||||
fetch_and_deploy_gh_release "opencloud" "opencloud-eu/opencloud" "singlefile" "v5.1.0" "/usr/bin" "opencloud-*-linux-amd64"
|
||||
fetch_and_deploy_gh_release "opencloud" "opencloud-eu/opencloud" "singlefile" "v5.0.2" "/usr/bin" "opencloud-*-linux-amd64"
|
||||
|
||||
msg_info "Configuring OpenCloud"
|
||||
DATA_DIR="/var/lib/opencloud"
|
||||
|
||||
@@ -80,7 +80,6 @@ $STD php artisan p:user:make --no-interaction --admin=1 --email "$ADMIN_EMAIL" -
|
||||
echo "* * * * * php /opt/pterodactyl-panel/artisan schedule:run >> /dev/null 2>&1" | crontab -u www-data -
|
||||
chown -R www-data:www-data /opt/pterodactyl-panel/*
|
||||
chmod -R 755 /opt/pterodactyl-panel/storage/* /opt/pterodactyl-panel/bootstrap/cache/
|
||||
ln -s /opt/pterodactyl-panel /var/www/pterodactyl
|
||||
{
|
||||
echo ""
|
||||
echo "pterodactyl Admin Username: admin"
|
||||
|
||||
@@ -14,25 +14,6 @@ catch_errors
|
||||
# Get LXC IP address (must be called INSIDE container, after network is up)
|
||||
get_lxc_ip
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# post_progress_to_api()
|
||||
#
|
||||
# - Lightweight progress ping from inside the container
|
||||
# - Updates the existing telemetry record status from "installing" to "configuring"
|
||||
# - Signals that the installation is actively progressing (not stuck)
|
||||
# - Fire-and-forget: never blocks or fails the script
|
||||
# - Only executes if DIAGNOSTICS=yes and RANDOM_UUID is set
|
||||
# ------------------------------------------------------------------------------
|
||||
post_progress_to_api() {
|
||||
command -v curl &>/dev/null || return 0
|
||||
[[ "${DIAGNOSTICS:-no}" == "no" ]] && return 0
|
||||
[[ -z "${RANDOM_UUID:-}" ]] && return 0
|
||||
|
||||
curl -fsS -m 5 -X POST "https://telemetry.community-scripts.org/telemetry" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"random_id\":\"${RANDOM_UUID}\",\"type\":\"lxc\",\"nsapp\":\"${app:-unknown}\",\"status\":\"configuring\"}" &>/dev/null || true
|
||||
}
|
||||
|
||||
# This function enables IPv6 if it's not disabled and sets verbose mode
|
||||
verb_ip6() {
|
||||
set_std_mode # Set STD mode based on VERBOSE
|
||||
@@ -72,7 +53,6 @@ setting_up_container() {
|
||||
fi
|
||||
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}"
|
||||
post_progress_to_api
|
||||
}
|
||||
|
||||
# This function checks the network connection by pinging a known IP address and prompts the user to continue if the internet is not connected
|
||||
@@ -105,18 +85,8 @@ network_check() {
|
||||
update_os() {
|
||||
msg_info "Updating Container OS"
|
||||
$STD apk -U upgrade
|
||||
local tools_content
|
||||
tools_content=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) || {
|
||||
msg_error "Failed to download tools.func"
|
||||
exit 6
|
||||
}
|
||||
source /dev/stdin <<<"$tools_content"
|
||||
if ! declare -f fetch_and_deploy_gh_release >/dev/null 2>&1; then
|
||||
msg_error "tools.func loaded but incomplete — missing expected functions"
|
||||
exit 6
|
||||
fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
msg_ok "Updated Container OS"
|
||||
post_progress_to_api
|
||||
}
|
||||
|
||||
# This function modifies the message of the day (motd) and SSH settings
|
||||
|
||||
@@ -908,9 +908,6 @@ categorize_error() {
|
||||
# Network errors (curl/wget)
|
||||
6 | 7 | 22 | 35) echo "network" ;;
|
||||
|
||||
# Docker / Privileged mode required
|
||||
10) echo "config" ;;
|
||||
|
||||
# Timeout errors
|
||||
28 | 124 | 211) echo "timeout" ;;
|
||||
|
||||
@@ -985,62 +982,6 @@ get_install_duration() {
|
||||
echo $((now - INSTALL_START_TIME))
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# _telemetry_report_exit()
|
||||
#
|
||||
# - Internal handler called by EXIT trap set in init_tool_telemetry()
|
||||
# - Determines success/failure from exit code and reports via appropriate API
|
||||
# - Arguments:
|
||||
# * $1: exit_code from the script
|
||||
# ------------------------------------------------------------------------------
|
||||
_telemetry_report_exit() {
|
||||
local ec="${1:-0}"
|
||||
local status="success"
|
||||
[[ "$ec" -ne 0 ]] && status="failed"
|
||||
|
||||
# Lazy name resolution: use explicit name, fall back to $APP, then "unknown"
|
||||
local name="${TELEMETRY_TOOL_NAME:-${APP:-unknown}}"
|
||||
|
||||
if [[ "${TELEMETRY_TOOL_TYPE:-tool}" == "addon" ]]; then
|
||||
post_addon_to_api "$name" "$status" "$ec"
|
||||
else
|
||||
post_tool_to_api "$name" "$status" "$ec"
|
||||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# init_tool_telemetry()
|
||||
#
|
||||
# - One-line telemetry setup for tools/addon scripts
|
||||
# - Reads DIAGNOSTICS from /usr/local/community-scripts/diagnostics
|
||||
# - Starts install timer for duration tracking
|
||||
# - Sets EXIT trap to automatically report success/failure on script exit
|
||||
# - Arguments:
|
||||
# * $1: tool_name (optional, falls back to $APP at exit time)
|
||||
# * $2: type ("tool" for PVE host scripts, "addon" for container addons)
|
||||
# - Usage:
|
||||
# source <(curl -fsSL .../misc/api.func) 2>/dev/null || true
|
||||
# init_tool_telemetry "post-pve-install" "tool"
|
||||
# init_tool_telemetry "" "addon" # uses $APP at exit time
|
||||
# ------------------------------------------------------------------------------
|
||||
init_tool_telemetry() {
|
||||
local name="${1:-}"
|
||||
local type="${2:-tool}"
|
||||
|
||||
[[ -n "$name" ]] && TELEMETRY_TOOL_NAME="$name"
|
||||
TELEMETRY_TOOL_TYPE="$type"
|
||||
|
||||
# Read diagnostics opt-in/opt-out
|
||||
if [[ -f /usr/local/community-scripts/diagnostics ]]; then
|
||||
DIAGNOSTICS=$(grep -i "^DIAGNOSTICS=" /usr/local/community-scripts/diagnostics 2>/dev/null | awk -F'=' '{print $2}') || true
|
||||
fi
|
||||
|
||||
start_install_timer
|
||||
|
||||
# EXIT trap: automatically report telemetry when script ends
|
||||
trap '_telemetry_report_exit "$?"' EXIT
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# post_tool_to_api()
|
||||
#
|
||||
|
||||
@@ -3427,7 +3427,6 @@ start() {
|
||||
VERBOSE="no"
|
||||
set_std_mode
|
||||
ensure_profile_loaded
|
||||
get_lxc_ip
|
||||
update_script
|
||||
update_motd_ip
|
||||
cleanup_lxc
|
||||
@@ -3455,7 +3454,6 @@ start() {
|
||||
;;
|
||||
esac
|
||||
ensure_profile_loaded
|
||||
get_lxc_ip
|
||||
update_script
|
||||
update_motd_ip
|
||||
cleanup_lxc
|
||||
@@ -4431,7 +4429,7 @@ EOF'
|
||||
export var_cpu="$CORE_COUNT"
|
||||
export VERBOSE="yes"
|
||||
export var_verbose="yes"
|
||||
export RECOVERY_ATTEMPT=$((${RECOVERY_ATTEMPT:-0} + 1))
|
||||
export RECOVERY_ATTEMPT=$(( ${RECOVERY_ATTEMPT:-0} + 1 ))
|
||||
|
||||
echo -e "${YW}Rebuilding with increased resources (attempt ${RECOVERY_ATTEMPT}/2):${CL}"
|
||||
echo -e " Container ID: ${old_ctid} → ${CTID}"
|
||||
@@ -5564,15 +5562,15 @@ api_exit_script() {
|
||||
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
|
||||
# exit_code=0 is never an error — report as success
|
||||
post_update_to_api "done" "0"
|
||||
# This catches edge cases like early returns after post_to_api()
|
||||
post_update_to_api "failed" "1"
|
||||
fi
|
||||
}
|
||||
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
trap 'api_exit_script' EXIT
|
||||
fi
|
||||
trap 'local _ec=$?; if [[ $_ec -ne 0 ]]; then ensure_log_on_host; post_update_to_api "failed" "$_ec"; fi' ERR
|
||||
trap '_ERR_CODE=$?; ensure_log_on_host; post_update_to_api "failed" "$_ERR_CODE"' ERR
|
||||
trap 'ensure_log_on_host; post_update_to_api "failed" "129"; exit 129' SIGHUP
|
||||
trap 'ensure_log_on_host; post_update_to_api "failed" "130"; exit 130' SIGINT
|
||||
trap 'ensure_log_on_host; post_update_to_api "failed" "143"; exit 143' SIGTERM
|
||||
|
||||
@@ -40,25 +40,6 @@ catch_errors
|
||||
# Get LXC IP address (must be called INSIDE container, after network is up)
|
||||
get_lxc_ip
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# post_progress_to_api()
|
||||
#
|
||||
# - Lightweight progress ping from inside the container
|
||||
# - Updates the existing telemetry record status from "installing" to "configuring"
|
||||
# - Signals that the installation is actively progressing (not stuck)
|
||||
# - Fire-and-forget: never blocks or fails the script
|
||||
# - Only executes if DIAGNOSTICS=yes and RANDOM_UUID is set
|
||||
# ------------------------------------------------------------------------------
|
||||
post_progress_to_api() {
|
||||
command -v curl &>/dev/null || return 0
|
||||
[[ "${DIAGNOSTICS:-no}" == "no" ]] && return 0
|
||||
[[ -z "${RANDOM_UUID:-}" ]] && return 0
|
||||
|
||||
curl -fsS -m 5 -X POST "https://telemetry.community-scripts.org/telemetry" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"random_id\":\"${RANDOM_UUID}\",\"type\":\"lxc\",\"nsapp\":\"${app:-unknown}\",\"status\":\"configuring\"}" &>/dev/null || true
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# SECTION 2: NETWORK & CONNECTIVITY
|
||||
# ==============================================================================
|
||||
@@ -122,7 +103,6 @@ setting_up_container() {
|
||||
msg_ok "Set up Container OS"
|
||||
#msg_custom "${CM}" "${GN}" "Network Connected: ${BL}$(hostname -I)"
|
||||
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
||||
post_progress_to_api
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -226,18 +206,8 @@ EOF
|
||||
$STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade
|
||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
msg_ok "Updated Container OS"
|
||||
post_progress_to_api
|
||||
|
||||
local tools_content
|
||||
tools_content=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func) || {
|
||||
msg_error "Failed to download tools.func"
|
||||
exit 6
|
||||
}
|
||||
source /dev/stdin <<<"$tools_content"
|
||||
if ! declare -f fetch_and_deploy_gh_release >/dev/null 2>&1; then
|
||||
msg_error "tools.func loaded but incomplete — missing expected functions"
|
||||
exit 6
|
||||
fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
|
||||
@@ -19,11 +19,6 @@ EOF
|
||||
}
|
||||
header_info
|
||||
set -e
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-netbird-lxc" "tool"
|
||||
|
||||
while true; do
|
||||
read -p "This will add NetBird to an existing LXC Container ONLY. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
|
||||
@@ -23,10 +23,6 @@ function msg_info() { echo -e " \e[1;36m➤\e[0m $1"; }
|
||||
function msg_ok() { echo -e " \e[1;32m✔\e[0m $1"; }
|
||||
function msg_error() { echo -e " \e[1;31m✖\e[0m $1"; }
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-tailscale-lxc" "tool"
|
||||
|
||||
header_info
|
||||
|
||||
if ! command -v pveversion &>/dev/null; then
|
||||
|
||||
@@ -13,7 +13,6 @@ fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
@@ -30,7 +29,6 @@ DEFAULT_PORT=8080
|
||||
|
||||
# Initialize all core functions (colors, formatting, icons, STD mode)
|
||||
load_functions
|
||||
init_tool_telemetry "" "addon"
|
||||
|
||||
# ==============================================================================
|
||||
# HEADER
|
||||
|
||||
@@ -42,11 +42,6 @@ function msg() {
|
||||
local TEXT="$1"
|
||||
echo -e "$TEXT"
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "all-templates" "tool"
|
||||
|
||||
function validate_container_id() {
|
||||
local ctid="$1"
|
||||
# Check if ID is numeric
|
||||
|
||||
@@ -28,11 +28,6 @@ HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
APP="Coder Code Server"
|
||||
hostname="$(hostname)"
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "coder-code-server" "addon"
|
||||
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
set -o nounset
|
||||
|
||||
@@ -13,13 +13,11 @@ fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
load_functions
|
||||
init_tool_telemetry "" "addon"
|
||||
|
||||
# ==============================================================================
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -17,11 +17,6 @@ HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
APP="CrowdSec"
|
||||
hostname="$(hostname)"
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "crowdsec" "addon"
|
||||
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
set -o nounset
|
||||
|
||||
@@ -32,10 +32,6 @@ DEFAULT_PORT=8080
|
||||
SRC_DIR="/"
|
||||
TMP_BIN="/tmp/filebrowser.$$"
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "filebrowser-quantum" "addon"
|
||||
|
||||
# Get primary IP
|
||||
IFACE=$(ip -4 route | awk '/default/ {print $5; exit}')
|
||||
IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
_______ __ ____
|
||||
/ ____(_) /__ / __ )_________ _ __________ _____
|
||||
/ /_ / / / _ \/ __ / ___/ __ \ | /| / / ___/ _ \/ ___/
|
||||
@@ -29,10 +29,6 @@ INSTALL_PATH="/usr/local/bin/filebrowser"
|
||||
DB_PATH="/usr/local/community-scripts/filebrowser.db"
|
||||
DEFAULT_PORT=8080
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "filebrowser" "addon"
|
||||
|
||||
# Get first non-loopback IP & Detect primary network interface dynamically
|
||||
IFACE=$(ip -4 route | awk '/default/ {print $5; exit}')
|
||||
IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1)
|
||||
@@ -42,65 +38,65 @@ IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n
|
||||
|
||||
# Detect OS
|
||||
if [[ -f "/etc/alpine-release" ]]; then
|
||||
OS="Alpine"
|
||||
SERVICE_PATH="/etc/init.d/filebrowser"
|
||||
PKG_MANAGER="apk add --no-cache"
|
||||
OS="Alpine"
|
||||
SERVICE_PATH="/etc/init.d/filebrowser"
|
||||
PKG_MANAGER="apk add --no-cache"
|
||||
elif [[ -f "/etc/debian_version" ]]; then
|
||||
OS="Debian"
|
||||
SERVICE_PATH="/etc/systemd/system/filebrowser.service"
|
||||
PKG_MANAGER="apt-get install -y"
|
||||
OS="Debian"
|
||||
SERVICE_PATH="/etc/systemd/system/filebrowser.service"
|
||||
PKG_MANAGER="apt-get install -y"
|
||||
else
|
||||
echo -e "${CROSS} Unsupported OS detected. Exiting."
|
||||
exit 1
|
||||
echo -e "${CROSS} Unsupported OS detected. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
header_info
|
||||
|
||||
function msg_info() {
|
||||
local msg="$1"
|
||||
echo -e "${INFO} ${YW}${msg}...${CL}"
|
||||
local msg="$1"
|
||||
echo -e "${INFO} ${YW}${msg}...${CL}"
|
||||
}
|
||||
|
||||
function msg_ok() {
|
||||
local msg="$1"
|
||||
echo -e "${CM} ${GN}${msg}${CL}"
|
||||
local msg="$1"
|
||||
echo -e "${CM} ${GN}${msg}${CL}"
|
||||
}
|
||||
|
||||
function msg_error() {
|
||||
local msg="$1"
|
||||
echo -e "${CROSS} ${RD}${msg}${CL}"
|
||||
local msg="$1"
|
||||
echo -e "${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
if [ -f "$INSTALL_PATH" ]; then
|
||||
echo -e "${YW}⚠️ ${APP} is already installed.${CL}"
|
||||
read -r -p "Would you like to uninstall ${APP}? (y/N): " uninstall_prompt
|
||||
if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Uninstalling ${APP}"
|
||||
if [[ "$OS" == "Debian" ]]; then
|
||||
systemctl disable --now filebrowser.service &>/dev/null
|
||||
rm -f "$SERVICE_PATH"
|
||||
else
|
||||
rc-service filebrowser stop &>/dev/null
|
||||
rc-update del filebrowser &>/dev/null
|
||||
rm -f "$SERVICE_PATH"
|
||||
echo -e "${YW}⚠️ ${APP} is already installed.${CL}"
|
||||
read -r -p "Would you like to uninstall ${APP}? (y/N): " uninstall_prompt
|
||||
if [[ "${uninstall_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Uninstalling ${APP}"
|
||||
if [[ "$OS" == "Debian" ]]; then
|
||||
systemctl disable --now filebrowser.service &>/dev/null
|
||||
rm -f "$SERVICE_PATH"
|
||||
else
|
||||
rc-service filebrowser stop &>/dev/null
|
||||
rc-update del filebrowser &>/dev/null
|
||||
rm -f "$SERVICE_PATH"
|
||||
fi
|
||||
rm -f "$INSTALL_PATH" "$DB_PATH"
|
||||
msg_ok "${APP} has been uninstalled."
|
||||
exit 0
|
||||
fi
|
||||
rm -f "$INSTALL_PATH" "$DB_PATH"
|
||||
msg_ok "${APP} has been uninstalled."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
read -r -p "Would you like to update ${APP}? (y/N): " update_prompt
|
||||
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Updating ${APP}"
|
||||
if ! command -v curl &>/dev/null; then $PKG_MANAGER curl &>/dev/null; fi
|
||||
curl -fsSL "https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz" | tar -xzv -C /usr/local/bin &>/dev/null
|
||||
chmod +x "$INSTALL_PATH"
|
||||
msg_ok "Updated ${APP}"
|
||||
exit 0
|
||||
else
|
||||
echo -e "${YW}⚠️ Update skipped. Exiting.${CL}"
|
||||
exit 0
|
||||
fi
|
||||
read -r -p "Would you like to update ${APP}? (y/N): " update_prompt
|
||||
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Updating ${APP}"
|
||||
if ! command -v curl &>/dev/null; then $PKG_MANAGER curl &>/dev/null; fi
|
||||
curl -fsSL "https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz" | tar -xzv -C /usr/local/bin &>/dev/null
|
||||
chmod +x "$INSTALL_PATH"
|
||||
msg_ok "Updated ${APP}"
|
||||
exit 0
|
||||
else
|
||||
echo -e "${YW}⚠️ Update skipped. Exiting.${CL}"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "${YW}⚠️ ${APP} is not installed.${CL}"
|
||||
@@ -109,43 +105,43 @@ PORT=${PORT:-$DEFAULT_PORT}
|
||||
|
||||
read -r -p "Would you like to install ${APP}? (y/n): " install_prompt
|
||||
if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing ${APP} on ${OS}"
|
||||
$PKG_MANAGER wget tar curl &>/dev/null
|
||||
curl -fsSL "https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz" | tar -xzv -C /usr/local/bin &>/dev/null
|
||||
chmod +x "$INSTALL_PATH"
|
||||
msg_ok "Installed ${APP}"
|
||||
msg_info "Installing ${APP} on ${OS}"
|
||||
$PKG_MANAGER wget tar curl &>/dev/null
|
||||
curl -fsSL "https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz" | tar -xzv -C /usr/local/bin &>/dev/null
|
||||
chmod +x "$INSTALL_PATH"
|
||||
msg_ok "Installed ${APP}"
|
||||
|
||||
msg_info "Creating FileBrowser directory"
|
||||
mkdir -p /usr/local/community-scripts
|
||||
chown root:root /usr/local/community-scripts
|
||||
chmod 755 /usr/local/community-scripts
|
||||
touch "$DB_PATH"
|
||||
chown root:root "$DB_PATH"
|
||||
chmod 644 "$DB_PATH"
|
||||
msg_ok "Directory created successfully"
|
||||
msg_info "Creating FileBrowser directory"
|
||||
mkdir -p /usr/local/community-scripts
|
||||
chown root:root /usr/local/community-scripts
|
||||
chmod 755 /usr/local/community-scripts
|
||||
touch "$DB_PATH"
|
||||
chown root:root "$DB_PATH"
|
||||
chmod 644 "$DB_PATH"
|
||||
msg_ok "Directory created successfully"
|
||||
|
||||
read -r -p "Would you like to use No Authentication? (y/N): " auth_prompt
|
||||
if [[ "${auth_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Configuring No Authentication"
|
||||
cd /usr/local/community-scripts
|
||||
filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
|
||||
filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
|
||||
filebrowser config init --auth.method=noauth &>/dev/null
|
||||
filebrowser config set --auth.method=noauth &>/dev/null
|
||||
filebrowser users add ID 1 --perm.admin &>/dev/null
|
||||
msg_ok "No Authentication configured"
|
||||
else
|
||||
msg_info "Setting up default authentication"
|
||||
cd /usr/local/community-scripts
|
||||
filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
|
||||
filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
|
||||
filebrowser users add admin helper-scripts.com --perm.admin --database "$DB_PATH" &>/dev/null
|
||||
msg_ok "Default authentication configured (admin:helper-scripts.com)"
|
||||
fi
|
||||
read -r -p "Would you like to use No Authentication? (y/N): " auth_prompt
|
||||
if [[ "${auth_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Configuring No Authentication"
|
||||
cd /usr/local/community-scripts
|
||||
filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
|
||||
filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
|
||||
filebrowser config init --auth.method=noauth &>/dev/null
|
||||
filebrowser config set --auth.method=noauth &>/dev/null
|
||||
filebrowser users add ID 1 --perm.admin &>/dev/null
|
||||
msg_ok "No Authentication configured"
|
||||
else
|
||||
msg_info "Setting up default authentication"
|
||||
cd /usr/local/community-scripts
|
||||
filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
|
||||
filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null
|
||||
filebrowser users add admin helper-scripts.com --perm.admin --database "$DB_PATH" &>/dev/null
|
||||
msg_ok "Default authentication configured (admin:helper-scripts.com)"
|
||||
fi
|
||||
|
||||
msg_info "Creating service"
|
||||
if [[ "$OS" == "Debian" ]]; then
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
msg_info "Creating service"
|
||||
if [[ "$OS" == "Debian" ]]; then
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
[Unit]
|
||||
Description=Filebrowser
|
||||
After=network-online.target
|
||||
@@ -161,9 +157,9 @@ Restart=always
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now filebrowser
|
||||
else
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
systemctl enable -q --now filebrowser
|
||||
else
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
#!/sbin/openrc-run
|
||||
|
||||
command="/usr/local/bin/filebrowser"
|
||||
@@ -176,14 +172,14 @@ depend() {
|
||||
need net
|
||||
}
|
||||
EOF
|
||||
chmod +x "$SERVICE_PATH"
|
||||
rc-update add filebrowser default &>/dev/null
|
||||
rc-service filebrowser start &>/dev/null
|
||||
fi
|
||||
msg_ok "Service created successfully"
|
||||
chmod +x "$SERVICE_PATH"
|
||||
rc-update add filebrowser default &>/dev/null
|
||||
rc-service filebrowser start &>/dev/null
|
||||
fi
|
||||
msg_ok "Service created successfully"
|
||||
|
||||
echo -e "${CM} ${GN}${APP} is reachable at: ${BL}http://$IP:$PORT${CL}"
|
||||
echo -e "${CM} ${GN}${APP} is reachable at: ${BL}http://$IP:$PORT${CL}"
|
||||
else
|
||||
echo -e "${YW}⚠️ Installation skipped. Exiting.${CL}"
|
||||
exit 0
|
||||
echo -e "${YW}⚠️ Installation skipped. Exiting.${CL}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -30,10 +30,6 @@ function msg_info() { echo -e "${INFO} ${YW}$1...${CL}"; }
|
||||
function msg_ok() { echo -e "${CM} ${GN}$1${CL}"; }
|
||||
function msg_error() { echo -e "${CROSS} ${RD}$1${CL}"; }
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "glances" "addon"
|
||||
|
||||
get_lxc_ip() {
|
||||
if command -v hostname >/dev/null 2>&1 && hostname -I 2>/dev/null; then
|
||||
hostname -I | awk '{print $1}'
|
||||
|
||||
@@ -13,7 +13,6 @@ fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
@@ -30,7 +29,6 @@ DEFAULT_PORT=3000
|
||||
|
||||
# Initialize all core functions (colors, formatting, icons, STD mode)
|
||||
load_functions
|
||||
init_tool_telemetry "" "addon"
|
||||
|
||||
# ==============================================================================
|
||||
# HEADER
|
||||
@@ -106,10 +104,6 @@ function update() {
|
||||
$STD npm run build
|
||||
msg_ok "Built ${APP}"
|
||||
|
||||
msg_info "Updating service"
|
||||
create_service
|
||||
msg_ok "Updated service"
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start immich-proxy
|
||||
msg_ok "Started service"
|
||||
@@ -118,27 +112,6 @@ function update() {
|
||||
fi
|
||||
}
|
||||
|
||||
function create_service() {
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
[Unit]
|
||||
Description=Immich Public Proxy
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=${INSTALL_PATH}/app
|
||||
EnvironmentFile=${CONFIG_PATH}/.env
|
||||
ExecStart=/usr/bin/node ${INSTALL_PATH}/app/dist/index.js
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# INSTALL
|
||||
# ==============================================================================
|
||||
@@ -200,7 +173,23 @@ EOF
|
||||
msg_ok "Created configuration"
|
||||
|
||||
msg_info "Creating service"
|
||||
create_service
|
||||
cat <<EOF >"$SERVICE_PATH"
|
||||
[Unit]
|
||||
Description=Immich Public Proxy
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=${INSTALL_PATH}
|
||||
EnvironmentFile=${CONFIG_PATH}/.env
|
||||
ExecStart=/usr/bin/node ${INSTALL_PATH}/app/server.js
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now immich-proxy
|
||||
msg_ok "Created and started service"
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
@@ -30,7 +29,6 @@ DEFAULT_PORT=3000
|
||||
|
||||
# Initialize all core functions (colors, formatting, icons, STD mode)
|
||||
load_functions
|
||||
init_tool_telemetry "" "addon"
|
||||
|
||||
# ==============================================================================
|
||||
# HEADER
|
||||
|
||||
@@ -26,11 +26,6 @@ BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
silent() { "$@" >/dev/null 2>&1; }
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "netdata" "tool"
|
||||
|
||||
set -e
|
||||
header_info
|
||||
echo "Loading..."
|
||||
|
||||
@@ -13,13 +13,11 @@ fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
load_functions
|
||||
init_tool_telemetry "" "addon"
|
||||
|
||||
# ==============================================================================
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -27,11 +27,6 @@ HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
APP="OliveTin"
|
||||
hostname="$(hostname)"
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "olivetin" "addon"
|
||||
|
||||
set-e
|
||||
header_info
|
||||
|
||||
|
||||
@@ -29,10 +29,6 @@ APP="phpMyAdmin"
|
||||
INSTALL_DIR_DEBIAN="/var/www/html/phpMyAdmin"
|
||||
INSTALL_DIR_ALPINE="/usr/share/phpmyadmin"
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "phpmyadmin" "addon"
|
||||
|
||||
IFACE=$(ip -4 route | awk '/default/ {print $5; exit}')
|
||||
IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1)
|
||||
[[ -z "$IP" ]] && IP=$(hostname -I | awk '{print $1}')
|
||||
|
||||
@@ -13,13 +13,11 @@ fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
load_functions
|
||||
init_tool_telemetry "" "addon"
|
||||
|
||||
# ==============================================================================
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -8,13 +8,11 @@
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
load_functions
|
||||
init_tool_telemetry "" "addon"
|
||||
|
||||
# ==============================================================================
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -28,11 +28,6 @@ function msg_error() {
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pyenv" "addon"
|
||||
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
msg_error "Can't Install on Proxmox "
|
||||
exit
|
||||
|
||||
@@ -13,13 +13,11 @@ fi
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/error_handler.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
|
||||
# Enable error handling
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
load_functions
|
||||
init_tool_telemetry "" "addon"
|
||||
|
||||
# ==============================================================================
|
||||
# CONFIGURATION
|
||||
|
||||
@@ -36,10 +36,6 @@ msg_ok() {
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "webmin" "addon"
|
||||
|
||||
header_info
|
||||
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Webmin Installer" --yesno "This Will Install Webmin on this LXC Container. Proceed?" 10 58
|
||||
|
||||
@@ -31,10 +31,6 @@ HOLD=" "
|
||||
CM="${GN}✓${CL} "
|
||||
CROSS="${RD}✗${CL} "
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-iptag" "tool"
|
||||
|
||||
# Stop any running spinner
|
||||
stop_spinner() {
|
||||
if [ -n "$SPINNER_PID" ] && kill -0 "$SPINNER_PID" 2>/dev/null; then
|
||||
|
||||
@@ -22,10 +22,6 @@ CM='\xE2\x9C\x94\033'
|
||||
GN="\033[1;92m"
|
||||
CL="\033[m"
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "clean-lxcs" "tool"
|
||||
|
||||
header_info
|
||||
echo "Loading..."
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
____ ________ ____ __ __ __ _ ____ ___
|
||||
/ __ \_________ _ ______ ___ ____ _ __ / ____/ /__ ____ _____ / __ \_________ / /_ ____ _____ ___ ____/ / / /| | / / |/ /____
|
||||
/ /_/ / ___/ __ \| |/_/ __ `__ \/ __ \| |/_/ / / / / _ \/ __ `/ __ \ / / / / ___/ __ \/ __ \/ __ `/ __ \/ _ \/ __ / / / | | / / /|_/ / ___/
|
||||
@@ -16,66 +16,62 @@ function header_info {
|
||||
EOF
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "clean-orphaned-lvm" "tool"
|
||||
|
||||
# Function to check for orphaned LVM volumes
|
||||
function find_orphaned_lvm {
|
||||
echo -e "\n🔍 Scanning for orphaned LVM volumes...\n"
|
||||
echo -e "\n🔍 Scanning for orphaned LVM volumes...\n"
|
||||
|
||||
orphaned_volumes=()
|
||||
while read -r lv vg size seg_type; do
|
||||
# Exclude system-critical LVs and Ceph OSDs
|
||||
if [[ "$lv" == "data" || "$lv" == "root" || "$lv" == "swap" || "$lv" =~ ^osd-block- ]]; then
|
||||
continue
|
||||
fi
|
||||
orphaned_volumes=()
|
||||
while read -r lv vg size seg_type; do
|
||||
# Exclude system-critical LVs and Ceph OSDs
|
||||
if [[ "$lv" == "data" || "$lv" == "root" || "$lv" == "swap" || "$lv" =~ ^osd-block- ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# Exclude thin pools (any name)
|
||||
if [[ "$seg_type" == "thin-pool" ]]; then
|
||||
continue
|
||||
fi
|
||||
# Exclude thin pools (any name)
|
||||
if [[ "$seg_type" == "thin-pool" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
container_id=$(echo "$lv" | grep -oE "[0-9]+" | head -1)
|
||||
# Check if the ID exists as a VM or LXC container
|
||||
if [ -f "/etc/pve/lxc/${container_id}.conf" ] || [ -f "/etc/pve/qemu-server/${container_id}.conf" ]; then
|
||||
continue
|
||||
fi
|
||||
container_id=$(echo "$lv" | grep -oE "[0-9]+" | head -1)
|
||||
# Check if the ID exists as a VM or LXC container
|
||||
if [ -f "/etc/pve/lxc/${container_id}.conf" ] || [ -f "/etc/pve/qemu-server/${container_id}.conf" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
orphaned_volumes+=("$lv" "$vg" "$size")
|
||||
done < <(lvs --noheadings -o lv_name,vg_name,lv_size,seg_type --separator ' ' 2>/dev/null | awk '{print $1, $2, $3, $4}')
|
||||
orphaned_volumes+=("$lv" "$vg" "$size")
|
||||
done < <(lvs --noheadings -o lv_name,vg_name,lv_size,seg_type --separator ' ' 2>/dev/null | awk '{print $1, $2, $3, $4}')
|
||||
|
||||
# Display orphaned volumes
|
||||
echo -e "❗ The following orphaned LVM volumes were found:\n"
|
||||
printf "%-25s %-10s %-10s\n" "LV Name" "VG" "Size"
|
||||
printf "%-25s %-10s %-10s\n" "-------------------------" "----------" "----------"
|
||||
# Display orphaned volumes
|
||||
echo -e "❗ The following orphaned LVM volumes were found:\n"
|
||||
printf "%-25s %-10s %-10s\n" "LV Name" "VG" "Size"
|
||||
printf "%-25s %-10s %-10s\n" "-------------------------" "----------" "----------"
|
||||
|
||||
for ((i = 0; i < ${#orphaned_volumes[@]}; i += 3)); do
|
||||
printf "%-25s %-10s %-10s\n" "${orphaned_volumes[i]}" "${orphaned_volumes[i + 1]}" "${orphaned_volumes[i + 2]}"
|
||||
done
|
||||
echo ""
|
||||
for ((i = 0; i < ${#orphaned_volumes[@]}; i += 3)); do
|
||||
printf "%-25s %-10s %-10s\n" "${orphaned_volumes[i]}" "${orphaned_volumes[i + 1]}" "${orphaned_volumes[i + 2]}"
|
||||
done
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Function to delete selected volumes
|
||||
function delete_orphaned_lvm {
|
||||
for ((i = 0; i < ${#orphaned_volumes[@]}; i += 3)); do
|
||||
lv="${orphaned_volumes[i]}"
|
||||
vg="${orphaned_volumes[i + 1]}"
|
||||
size="${orphaned_volumes[i + 2]}"
|
||||
for ((i = 0; i < ${#orphaned_volumes[@]}; i += 3)); do
|
||||
lv="${orphaned_volumes[i]}"
|
||||
vg="${orphaned_volumes[i + 1]}"
|
||||
size="${orphaned_volumes[i + 2]}"
|
||||
|
||||
read -p "❓ Do you want to delete $lv (VG: $vg, Size: $size)? [y/N]: " confirm
|
||||
if [[ "$confirm" =~ ^[Yy]$ ]]; then
|
||||
echo -e "🗑️ Deleting $lv from $vg..."
|
||||
lvremove -f "$vg/$lv"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "✅ Successfully deleted $lv.\n"
|
||||
else
|
||||
echo -e "❌ Failed to delete $lv.\n"
|
||||
fi
|
||||
else
|
||||
echo -e "⚠️ Skipping $lv.\n"
|
||||
fi
|
||||
done
|
||||
read -p "❓ Do you want to delete $lv (VG: $vg, Size: $size)? [y/N]: " confirm
|
||||
if [[ "$confirm" =~ ^[Yy]$ ]]; then
|
||||
echo -e "🗑️ Deleting $lv from $vg..."
|
||||
lvremove -f "$vg/$lv"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "✅ Successfully deleted $lv.\n"
|
||||
else
|
||||
echo -e "❌ Failed to delete $lv.\n"
|
||||
fi
|
||||
else
|
||||
echo -e "⚠️ Skipping $lv.\n"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Run script
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
clear
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Can't Run from the Proxmox Shell"
|
||||
exit
|
||||
echo -e "⚠️ Can't Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
@@ -23,16 +23,16 @@ CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
APP="Home Assistant Container"
|
||||
while true; do
|
||||
read -p "This will restore ${APP} from a backup. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
read -p "This will restore ${APP} from a backup. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
cat <<"EOF"
|
||||
cat <<"EOF"
|
||||
__ __ ___ _ __ __
|
||||
/ / / /___ ____ ___ ___ / | __________(_)____/ /_____ _____ / /_
|
||||
/ /_/ / __ \/ __ `__ \/ _ \ / /| | / ___/ ___/ / ___/ __/ __ `/ __ \/ __/
|
||||
@@ -44,39 +44,35 @@ EOF
|
||||
|
||||
header_info
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "container-restore" "tool"
|
||||
|
||||
function msg_info() {
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||
}
|
||||
function msg_ok() {
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
}
|
||||
function msg_error() {
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
if [ -z "$(ls -A /var/lib/docker/volumes/hass_config/_data/backups/)" ]; then
|
||||
msg_error "No backups found! \n"
|
||||
exit 1
|
||||
msg_error "No backups found! \n"
|
||||
exit 1
|
||||
fi
|
||||
DIR=/var/lib/docker/volumes/hass_config/_data/restore
|
||||
if [ -d "$DIR" ]; then
|
||||
msg_ok "Restore Directory Exists."
|
||||
msg_ok "Restore Directory Exists."
|
||||
else
|
||||
mkdir -p /var/lib/docker/volumes/hass_config/_data/restore
|
||||
msg_ok "Created Restore Directory."
|
||||
mkdir -p /var/lib/docker/volumes/hass_config/_data/restore
|
||||
msg_ok "Created Restore Directory."
|
||||
fi
|
||||
cd /var/lib/docker/volumes/hass_config/_data/backups/
|
||||
PS3="Please enter your choice: "
|
||||
files="$(ls -A .)"
|
||||
select filename in ${files}; do
|
||||
msg_ok "You selected ${BL}${filename}${CL}"
|
||||
break
|
||||
msg_ok "You selected ${BL}${filename}${CL}"
|
||||
break
|
||||
done
|
||||
msg_info "Stopping Home Assistant"
|
||||
docker stop homeassistant &>/dev/null
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
clear
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "⚠️ Can't Run from the Proxmox Shell"
|
||||
exit
|
||||
echo -e "⚠️ Can't Run from the Proxmox Shell"
|
||||
exit
|
||||
fi
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
@@ -23,16 +23,16 @@ CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
APP="Home Assistant Core"
|
||||
while true; do
|
||||
read -p "This will restore ${APP} from a backup. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
read -p "This will restore ${APP} from a backup. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
cat <<"EOF"
|
||||
cat <<"EOF"
|
||||
__ __ ___ _ __ __ ______
|
||||
/ / / /___ ____ ___ ___ / | __________(_)____/ /_____ _____ / /_ / ____/___ ________
|
||||
/ /_/ / __ \/ __ `__ \/ _ \ / /| | / ___/ ___/ / ___/ __/ __ `/ __ \/ __/ / / / __ \/ ___/ _ \
|
||||
@@ -44,39 +44,35 @@ EOF
|
||||
|
||||
header_info
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "core-restore" "tool"
|
||||
|
||||
function msg_info() {
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||
}
|
||||
function msg_ok() {
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
}
|
||||
function msg_error() {
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
if [ -z "$(ls -A /root/.homeassistant/backups/)" ]; then
|
||||
msg_error "No backups found! \n"
|
||||
exit 1
|
||||
msg_error "No backups found! \n"
|
||||
exit 1
|
||||
fi
|
||||
DIR=/root/.homeassistant/restore
|
||||
if [ -d "$DIR" ]; then
|
||||
msg_ok "Restore Directory Exists."
|
||||
msg_ok "Restore Directory Exists."
|
||||
else
|
||||
mkdir -p /root/.homeassistant/restore
|
||||
msg_ok "Created Restore Directory."
|
||||
mkdir -p /root/.homeassistant/restore
|
||||
msg_ok "Created Restore Directory."
|
||||
fi
|
||||
cd /root/.homeassistant/backups/
|
||||
PS3="Please enter your choice: "
|
||||
files="$(ls -A .)"
|
||||
select filename in ${files}; do
|
||||
msg_ok "You selected ${BL}${filename}${CL}"
|
||||
break
|
||||
msg_ok "You selected ${BL}${filename}${CL}"
|
||||
break
|
||||
done
|
||||
msg_info "Stopping Home Assistant"
|
||||
sudo service homeassistant stop
|
||||
|
||||
@@ -22,11 +22,6 @@ RD=$(echo "\033[01;31m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "execute-lxcs" "tool"
|
||||
|
||||
header_info
|
||||
echo "Loading..."
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE LXC Execute" --yesno "This will execute a command inside selected LXC Containers. Proceed?" 10 58
|
||||
@@ -45,6 +40,7 @@ if [ $? -ne 0 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
read -r -p "Enter here command for inside the containers: " custom_command
|
||||
|
||||
header_info
|
||||
@@ -54,11 +50,12 @@ function execute_in() {
|
||||
container=$1
|
||||
name=$(pct exec "$container" hostname)
|
||||
echo -e "${BL}[Info]${GN} Execute inside${BL} ${name}${GN} with output: ${CL}"
|
||||
if ! pct exec "$container" -- bash -c "command ${custom_command} >/dev/null 2>&1"; then
|
||||
echo -e "${BL}[Info]${GN} Skipping ${name} ${RD}$container has no command: ${custom_command}"
|
||||
else
|
||||
pct exec "$container" -- bash -c "${custom_command}" | tee
|
||||
fi
|
||||
if ! pct exec "$container" -- bash -c "command ${custom_command} >/dev/null 2>&1"
|
||||
then
|
||||
echo -e "${BL}[Info]${GN} Skipping ${name} ${RD}$container has no command: ${custom_command}"
|
||||
else
|
||||
pct exec "$container" -- bash -c "${custom_command}" | tee
|
||||
fi
|
||||
}
|
||||
|
||||
for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||
|
||||
@@ -15,11 +15,6 @@ function header_info {
|
||||
/___/ /_/ /_/
|
||||
EOF
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "frigate-support" "tool"
|
||||
|
||||
header_info
|
||||
while true; do
|
||||
read -p "This will Prepare a LXC Container for Frigate. Proceed (y/n)?" yn
|
||||
|
||||
@@ -19,10 +19,6 @@ RD="\033[01;31m"
|
||||
GN="\033[1;92m"
|
||||
CL="\033[m"
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "fstrim" "tool"
|
||||
|
||||
LOGFILE="/var/log/fstrim.log"
|
||||
touch "$LOGFILE"
|
||||
chmod 600 "$LOGFILE"
|
||||
|
||||
@@ -16,10 +16,6 @@ function header_info {
|
||||
EOF
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "host-backup" "tool"
|
||||
|
||||
# Function to perform backup
|
||||
function perform_backup {
|
||||
local BACKUP_PATH
|
||||
|
||||
@@ -29,11 +29,6 @@ BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
set -e
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "hw-acceleration" "tool"
|
||||
|
||||
header_info
|
||||
echo "Loading..."
|
||||
function msg_info() {
|
||||
|
||||
@@ -22,10 +22,6 @@ GN="\033[1;92m"
|
||||
RD="\033[01;31m"
|
||||
CL="\033[m"
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "kernel-clean" "tool"
|
||||
|
||||
# Detect current kernel
|
||||
current_kernel=$(uname -r)
|
||||
available_kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print $2}' | grep -v "$current_kernel" | sort -V)
|
||||
|
||||
@@ -25,11 +25,6 @@ HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
current_kernel=$(uname -r)
|
||||
available_kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print substr($2, 16, length($2)-22)}')
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "kernel-pin" "tool"
|
||||
|
||||
header_info
|
||||
|
||||
function msg_info() {
|
||||
|
||||
@@ -38,10 +38,6 @@ CL=$(echo "\033[m")
|
||||
TAB=" "
|
||||
CM="${TAB}✔️${TAB}${CL}"
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "lxc-delete" "tool"
|
||||
|
||||
header_info
|
||||
echo "Loading..."
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE LXC Deletion" --yesno "This will delete LXC containers. Proceed?" 10 58
|
||||
|
||||
@@ -29,10 +29,6 @@ msg_info() { echo -ne " ${HOLD} ${YW}$1..."; }
|
||||
msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; }
|
||||
msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; }
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "microcode" "tool"
|
||||
|
||||
header_info
|
||||
current_microcode=$(journalctl -k | grep -i 'microcode: Current revision:' | grep -oP 'Current revision: \K0x[0-9a-f]+')
|
||||
[ -z "$current_microcode" ] && current_microcode="Not found."
|
||||
|
||||
@@ -15,10 +15,6 @@ cat <<"EOF"
|
||||
|
||||
EOF
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "monitor-all" "tool"
|
||||
|
||||
add() {
|
||||
echo -e "\n IMPORTANT: Tag-Based Monitoring Enabled"
|
||||
echo "Only VMs and containers with the tag 'mon-restart' will be automatically restarted by this service."
|
||||
@@ -32,9 +28,9 @@ add() {
|
||||
while true; do
|
||||
read -p "This script will add Monitor All to Proxmox VE. Proceed (y/n)? " yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -179,8 +175,5 @@ CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Monitor-All f
|
||||
case $CHOICE in
|
||||
"Add") add ;;
|
||||
"Remove") remove ;;
|
||||
*)
|
||||
echo "Exiting..."
|
||||
exit 0
|
||||
;;
|
||||
*) echo "Exiting..."; exit 0 ;;
|
||||
esac
|
||||
|
||||
@@ -19,8 +19,8 @@ INFO="${TAB}ℹ️${TAB}${CL}"
|
||||
WARN="${TAB}⚠️${TAB}${CL}"
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
clear
|
||||
cat <<"EOF"
|
||||
|
||||
_ ____________ ____ __________ ___ ____ _ __ __
|
||||
/ | / / _/ ____/ / __ \/ __/ __/ /___ ____ _____/ (_)___ ____ _ / __ \(_)________ _/ /_ / /__ _____
|
||||
@@ -33,10 +33,6 @@ Enhanced version supporting both e1000e and e1000 drivers
|
||||
EOF
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "nic-offloading-fix" "tool"
|
||||
|
||||
header_info
|
||||
|
||||
function msg_info() { echo -e "${INFO} ${YW}${1}...${CL}"; }
|
||||
@@ -46,18 +42,15 @@ function msg_warn() { echo -e "${WARN} ${YWB}${1}"; }
|
||||
|
||||
# Check for root privileges
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
msg_error "Error: This script must be run as root."
|
||||
exit 1
|
||||
msg_error "Error: This script must be run as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v ethtool >/dev/null 2>&1; then
|
||||
msg_info "Installing ethtool"
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y ethtool &>/dev/null || {
|
||||
msg_error "Failed to install ethtool. Exiting."
|
||||
exit 1
|
||||
}
|
||||
msg_ok "ethtool installed successfully"
|
||||
msg_info "Installing ethtool"
|
||||
apt-get update &>/dev/null
|
||||
apt-get install -y ethtool &>/dev/null || { msg_error "Failed to install ethtool. Exiting."; exit 1; }
|
||||
msg_ok "ethtool installed successfully"
|
||||
fi
|
||||
|
||||
# Get list of network interfaces using Intel e1000e or e1000 drivers
|
||||
@@ -67,95 +60,95 @@ COUNT=0
|
||||
msg_info "Searching for Intel e1000e and e1000 interfaces"
|
||||
|
||||
for device in /sys/class/net/*; do
|
||||
interface="$(basename "$device")" # or adjust the rest of the usages below, as mostly you'll use the path anyway
|
||||
# Skip loopback interface and virtual interfaces
|
||||
if [[ "$interface" != "lo" ]] && [[ ! "$interface" =~ ^(tap|fwbr|veth|vmbr|bonding_masters) ]]; then
|
||||
# Check if the interface uses the e1000e or e1000 driver
|
||||
driver=$(basename $(readlink -f /sys/class/net/$interface/device/driver 2>/dev/null) 2>/dev/null)
|
||||
|
||||
if [[ "$driver" == "e1000e" ]] || [[ "$driver" == "e1000" ]]; then
|
||||
# Get MAC address for additional identification
|
||||
mac=$(cat /sys/class/net/$interface/address 2>/dev/null)
|
||||
INTERFACES+=("$interface" "Intel $driver NIC ($mac)")
|
||||
((COUNT++))
|
||||
interface="$(basename "$device")" # or adjust the rest of the usages below, as mostly you'll use the path anyway
|
||||
# Skip loopback interface and virtual interfaces
|
||||
if [[ "$interface" != "lo" ]] && [[ ! "$interface" =~ ^(tap|fwbr|veth|vmbr|bonding_masters) ]]; then
|
||||
# Check if the interface uses the e1000e or e1000 driver
|
||||
driver=$(basename $(readlink -f /sys/class/net/$interface/device/driver 2>/dev/null) 2>/dev/null)
|
||||
|
||||
if [[ "$driver" == "e1000e" ]] || [[ "$driver" == "e1000" ]]; then
|
||||
# Get MAC address for additional identification
|
||||
mac=$(cat /sys/class/net/$interface/address 2>/dev/null)
|
||||
INTERFACES+=("$interface" "Intel $driver NIC ($mac)")
|
||||
((COUNT++))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if any Intel e1000e/e1000 interfaces were found
|
||||
if [ ${#INTERFACES[@]} -eq 0 ]; then
|
||||
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."
|
||||
exit 1
|
||||
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."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
msg_ok "Found ${BL}$COUNT${GN} Intel e1000e/e1000 interfaces"
|
||||
|
||||
# Create a checklist for interface selection with all interfaces initially checked
|
||||
INTERFACES_CHECKLIST=()
|
||||
for ((i = 0; i < ${#INTERFACES[@]}; i += 2)); do
|
||||
INTERFACES_CHECKLIST+=("${INTERFACES[i]}" "${INTERFACES[i + 1]}" "ON")
|
||||
for ((i=0; i<${#INTERFACES[@]}; i+=2)); do
|
||||
INTERFACES_CHECKLIST+=("${INTERFACES[i]}" "${INTERFACES[i+1]}" "ON")
|
||||
done
|
||||
|
||||
# Show interface selection checklist
|
||||
SELECTED_INTERFACES=$(whiptail --backtitle "Intel e1000e/e1000 NIC Offloading Disabler" --title "Network Interfaces" \
|
||||
--separate-output --checklist "Select Intel e1000e/e1000 network interfaces\n(Space to toggle, Enter to confirm):" 15 80 6 \
|
||||
"${INTERFACES_CHECKLIST[@]}" 3>&1 1>&2 2>&3)
|
||||
--separate-output --checklist "Select Intel e1000e/e1000 network interfaces\n(Space to toggle, Enter to confirm):" 15 80 6 \
|
||||
"${INTERFACES_CHECKLIST[@]}" 3>&1 1>&2 2>&3)
|
||||
|
||||
exitstatus=$?
|
||||
if [ $exitstatus != 0 ]; then
|
||||
msg_info "User canceled. Exiting."
|
||||
exit 0
|
||||
msg_info "User canceled. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if any interfaces were selected
|
||||
if [ -z "$SELECTED_INTERFACES" ]; then
|
||||
msg_error "No interfaces selected. Exiting."
|
||||
exit 0
|
||||
msg_error "No interfaces selected. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Convert the selected interfaces into an array
|
||||
readarray -t INTERFACE_ARRAY <<<"$SELECTED_INTERFACES"
|
||||
readarray -t INTERFACE_ARRAY <<< "$SELECTED_INTERFACES"
|
||||
|
||||
# Show the number of selected interfaces
|
||||
INTERFACE_COUNT=${#INTERFACE_ARRAY[@]}
|
||||
|
||||
# Print selected interfaces with their driver types
|
||||
for iface in "${INTERFACE_ARRAY[@]}"; do
|
||||
driver=$(basename $(readlink -f /sys/class/net/$iface/device/driver 2>/dev/null) 2>/dev/null)
|
||||
msg_ok "Selected interface: ${BL}$iface${GN} (${BL}$driver${GN})"
|
||||
driver=$(basename $(readlink -f /sys/class/net/$iface/device/driver 2>/dev/null) 2>/dev/null)
|
||||
msg_ok "Selected interface: ${BL}$iface${GN} (${BL}$driver${GN})"
|
||||
done
|
||||
|
||||
# Ask for confirmation with the list of selected interfaces
|
||||
CONFIRMATION_MSG="You have selected the following interface(s):\n\n"
|
||||
for iface in "${INTERFACE_ARRAY[@]}"; do
|
||||
SPEED=$(cat /sys/class/net/$iface/speed 2>/dev/null || echo "Unknown")
|
||||
MAC=$(cat /sys/class/net/$iface/address 2>/dev/null)
|
||||
DRIVER=$(basename $(readlink -f /sys/class/net/$iface/device/driver 2>/dev/null) 2>/dev/null)
|
||||
CONFIRMATION_MSG+="- $iface (Driver: $DRIVER, MAC: $MAC, Speed: ${SPEED}Mbps)\n"
|
||||
SPEED=$(cat /sys/class/net/$iface/speed 2>/dev/null || echo "Unknown")
|
||||
MAC=$(cat /sys/class/net/$iface/address 2>/dev/null)
|
||||
DRIVER=$(basename $(readlink -f /sys/class/net/$iface/device/driver 2>/dev/null) 2>/dev/null)
|
||||
CONFIRMATION_MSG+="- $iface (Driver: $DRIVER, MAC: $MAC, Speed: ${SPEED}Mbps)\n"
|
||||
done
|
||||
CONFIRMATION_MSG+="\nThis will create systemd service(s) to disable offloading features.\n\nProceed?"
|
||||
|
||||
if ! whiptail --backtitle "Intel e1000e/e1000 NIC Offloading Disabler" --title "Confirmation" \
|
||||
--yesno "$CONFIRMATION_MSG" 20 80; then
|
||||
msg_info "User canceled. Exiting."
|
||||
exit 0
|
||||
--yesno "$CONFIRMATION_MSG" 20 80; then
|
||||
msg_info "User canceled. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Loop through all selected interfaces and create services for each
|
||||
for SELECTED_INTERFACE in "${INTERFACE_ARRAY[@]}"; do
|
||||
# Get the driver type for this specific interface
|
||||
DRIVER=$(basename $(readlink -f /sys/class/net/$SELECTED_INTERFACE/device/driver 2>/dev/null) 2>/dev/null)
|
||||
|
||||
# Create service name for this interface
|
||||
SERVICE_NAME="disable-nic-offload-$SELECTED_INTERFACE.service"
|
||||
SERVICE_PATH="/etc/systemd/system/$SERVICE_NAME"
|
||||
|
||||
# Create the service file with driver-specific optimizations
|
||||
msg_info "Creating systemd service for interface: ${BL}$SELECTED_INTERFACE${YW} (${BL}$DRIVER${YW})"
|
||||
|
||||
# Start with the common part of the service file
|
||||
cat >"$SERVICE_PATH" <<EOF
|
||||
# Get the driver type for this specific interface
|
||||
DRIVER=$(basename $(readlink -f /sys/class/net/$SELECTED_INTERFACE/device/driver 2>/dev/null) 2>/dev/null)
|
||||
|
||||
# Create service name for this interface
|
||||
SERVICE_NAME="disable-nic-offload-$SELECTED_INTERFACE.service"
|
||||
SERVICE_PATH="/etc/systemd/system/$SERVICE_NAME"
|
||||
|
||||
# Create the service file with driver-specific optimizations
|
||||
msg_info "Creating systemd service for interface: ${BL}$SELECTED_INTERFACE${YW} (${BL}$DRIVER${YW})"
|
||||
|
||||
# Start with the common part of the service file
|
||||
cat > "$SERVICE_PATH" << EOF
|
||||
[Unit]
|
||||
Description=Disable NIC offloading for Intel $DRIVER interface $SELECTED_INTERFACE
|
||||
After=network.target
|
||||
@@ -170,49 +163,45 @@ RemainAfterExit=true
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Check if service file was created successfully
|
||||
if [ ! -f "$SERVICE_PATH" ]; then
|
||||
whiptail --title "Error" --msgbox "Failed to create service file for $SELECTED_INTERFACE!" 10 50
|
||||
msg_error "Failed to create service file for $SELECTED_INTERFACE! Skipping to next interface."
|
||||
continue
|
||||
fi
|
||||
# Check if service file was created successfully
|
||||
if [ ! -f "$SERVICE_PATH" ]; then
|
||||
whiptail --title "Error" --msgbox "Failed to create service file for $SELECTED_INTERFACE!" 10 50
|
||||
msg_error "Failed to create service file for $SELECTED_INTERFACE! Skipping to next interface."
|
||||
continue
|
||||
fi
|
||||
|
||||
# Configure this service
|
||||
{
|
||||
echo "25"
|
||||
sleep 0.2
|
||||
# Reload systemd to recognize the new service
|
||||
systemctl daemon-reload
|
||||
echo "50"
|
||||
sleep 0.2
|
||||
# Start the service
|
||||
systemctl start "$SERVICE_NAME"
|
||||
echo "75"
|
||||
sleep 0.2
|
||||
# Enable the service to start on boot
|
||||
systemctl enable "$SERVICE_NAME"
|
||||
echo "100"
|
||||
sleep 0.2
|
||||
} | whiptail --backtitle "Intel e1000e/e1000 NIC Offloading Disabler" --gauge "Configuring service for $SELECTED_INTERFACE..." 10 80 0
|
||||
# Configure this service
|
||||
{
|
||||
echo "25"; sleep 0.2
|
||||
# Reload systemd to recognize the new service
|
||||
systemctl daemon-reload
|
||||
echo "50"; sleep 0.2
|
||||
# Start the service
|
||||
systemctl start "$SERVICE_NAME"
|
||||
echo "75"; sleep 0.2
|
||||
# Enable the service to start on boot
|
||||
systemctl enable "$SERVICE_NAME"
|
||||
echo "100"; sleep 0.2
|
||||
} | whiptail --backtitle "Intel e1000e/e1000 NIC Offloading Disabler" --gauge "Configuring service for $SELECTED_INTERFACE..." 10 80 0
|
||||
|
||||
# Individual service status
|
||||
if systemctl is-active --quiet "$SERVICE_NAME"; then
|
||||
SERVICE_STATUS="Active"
|
||||
else
|
||||
SERVICE_STATUS="Inactive"
|
||||
fi
|
||||
# Individual service status
|
||||
if systemctl is-active --quiet "$SERVICE_NAME"; then
|
||||
SERVICE_STATUS="Active"
|
||||
else
|
||||
SERVICE_STATUS="Inactive"
|
||||
fi
|
||||
|
||||
if systemctl is-enabled --quiet "$SERVICE_NAME"; then
|
||||
BOOT_STATUS="Enabled"
|
||||
else
|
||||
BOOT_STATUS="Disabled"
|
||||
fi
|
||||
if systemctl is-enabled --quiet "$SERVICE_NAME"; then
|
||||
BOOT_STATUS="Enabled"
|
||||
else
|
||||
BOOT_STATUS="Disabled"
|
||||
fi
|
||||
|
||||
# Show individual service results
|
||||
msg_ok "Service for ${BL}$SELECTED_INTERFACE${GN} (${BL}$DRIVER${GN}) created and enabled!"
|
||||
msg_info "${TAB}Service: ${BL}$SERVICE_NAME${YW}"
|
||||
msg_info "${TAB}Status: ${BL}$SERVICE_STATUS${YW}"
|
||||
msg_info "${TAB}Start on boot: ${BL}$BOOT_STATUS${YW}"
|
||||
# Show individual service results
|
||||
msg_ok "Service for ${BL}$SELECTED_INTERFACE${GN} (${BL}$DRIVER${GN}) created and enabled!"
|
||||
msg_info "${TAB}Service: ${BL}$SERVICE_NAME${YW}"
|
||||
msg_info "${TAB}Status: ${BL}$SERVICE_STATUS${YW}"
|
||||
msg_info "${TAB}Start on boot: ${BL}$BOOT_STATUS${YW}"
|
||||
done
|
||||
|
||||
# Prepare summary of all interfaces
|
||||
@@ -220,22 +209,22 @@ SUMMARY_MSG="Services created successfully!\n\n"
|
||||
SUMMARY_MSG+="Configured Interfaces:\n"
|
||||
|
||||
for iface in "${INTERFACE_ARRAY[@]}"; do
|
||||
SERVICE_NAME="disable-nic-offload-$iface.service"
|
||||
DRIVER=$(basename $(readlink -f /sys/class/net/$iface/device/driver 2>/dev/null) 2>/dev/null)
|
||||
SERVICE_NAME="disable-nic-offload-$iface.service"
|
||||
DRIVER=$(basename $(readlink -f /sys/class/net/$iface/device/driver 2>/dev/null) 2>/dev/null)
|
||||
|
||||
if systemctl is-active --quiet "$SERVICE_NAME"; then
|
||||
SVC_STATUS="Active"
|
||||
else
|
||||
SVC_STATUS="Inactive"
|
||||
fi
|
||||
|
||||
if systemctl is-active --quiet "$SERVICE_NAME"; then
|
||||
SVC_STATUS="Active"
|
||||
else
|
||||
SVC_STATUS="Inactive"
|
||||
fi
|
||||
if systemctl is-enabled --quiet "$SERVICE_NAME"; then
|
||||
BOOT_SVC_STATUS="Enabled"
|
||||
else
|
||||
BOOT_SVC_STATUS="Disabled"
|
||||
fi
|
||||
|
||||
if systemctl is-enabled --quiet "$SERVICE_NAME"; then
|
||||
BOOT_SVC_STATUS="Enabled"
|
||||
else
|
||||
BOOT_SVC_STATUS="Disabled"
|
||||
fi
|
||||
|
||||
SUMMARY_MSG+="- $iface ($DRIVER): $SVC_STATUS, Boot: $BOOT_SVC_STATUS\n"
|
||||
SUMMARY_MSG+="- $iface ($DRIVER): $SVC_STATUS, Boot: $BOOT_SVC_STATUS\n"
|
||||
done
|
||||
|
||||
# Show summary results
|
||||
@@ -247,8 +236,8 @@ msg_ok "Intel e1000e/e1000 optimization complete for ${#INTERFACE_ARRAY[@]} inte
|
||||
echo ""
|
||||
msg_info "Verification commands:"
|
||||
for iface in "${INTERFACE_ARRAY[@]}"; do
|
||||
echo -e "${TAB}${BL}ethtool -k $iface${CL} ${YW}# Check offloading status${CL}"
|
||||
echo -e "${TAB}${BL}systemctl status disable-nic-offload-$iface.service${CL} ${YW}# Check service status${CL}"
|
||||
echo -e "${TAB}${BL}ethtool -k $iface${CL} ${YW}# Check offloading status${CL}"
|
||||
echo -e "${TAB}${BL}systemctl status disable-nic-offload-$iface.service${CL} ${YW}# Check service status${CL}"
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -44,10 +44,6 @@ msg_error() {
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pbs3-upgrade" "tool"
|
||||
|
||||
start_routines() {
|
||||
header_info
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PBS 2 BACKUP" --menu "\nMake a backup of /etc/proxmox-backup to ensure that in the worst case, any relevant configuration can be recovered?" 14 58 2 \
|
||||
|
||||
@@ -32,10 +32,6 @@ msg_info() { echo -ne " ${HOLD} ${YW}$1..."; }
|
||||
msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; }
|
||||
msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; }
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pbs4-upgrade" "tool"
|
||||
|
||||
start_routines() {
|
||||
header_info
|
||||
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PBS 3 BACKUP" --menu \
|
||||
|
||||
@@ -28,10 +28,6 @@ CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
|
||||
msg_info() { echo -ne " ${HOLD} ${YW}$1..."; }
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pbs-microcode" "tool"
|
||||
msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; }
|
||||
msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; }
|
||||
|
||||
|
||||
@@ -32,10 +32,6 @@ msg_info() { echo -ne " ${HOLD} ${YW}$1..."; }
|
||||
msg_ok() { echo -e "${BFR} ${CM} ${GN}$1${CL}"; }
|
||||
msg_error() { echo -e "${BFR} ${CROSS} ${RD}$1${CL}"; }
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "post-pbs-install" "tool"
|
||||
|
||||
# ---- helpers ----
|
||||
get_pbs_codename() {
|
||||
awk -F'=' '/^VERSION_CODENAME=/{print $2}' /etc/os-release
|
||||
|
||||
@@ -43,10 +43,6 @@ msg_error() {
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "post-pmg-install" "tool"
|
||||
|
||||
if ! grep -q "Proxmox Mail Gateway" /etc/issue 2>/dev/null; then
|
||||
msg_error "This script is only intended for Proxmox Mail Gateway"
|
||||
exit 1
|
||||
|
||||
@@ -44,10 +44,6 @@ msg_error() {
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "post-pve-install" "tool"
|
||||
|
||||
get_pve_version() {
|
||||
local pve_ver
|
||||
pve_ver="$(pveversion | awk -F'/' '{print $2}' | awk -F'-' '{print $1}')"
|
||||
|
||||
@@ -11,9 +11,7 @@ if ! command -v curl >/dev/null 2>&1; then
|
||||
apt-get install -y curl >/dev/null 2>&1
|
||||
fi
|
||||
source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVE/raw/branch/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
load_functions
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pve-privilege-converter" "tool"
|
||||
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
|
||||
@@ -44,10 +44,6 @@ msg_error() {
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "pve8-upgrade" "tool"
|
||||
|
||||
start_routines() {
|
||||
header_info
|
||||
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
set -e
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "scaling-governor" "tool"
|
||||
|
||||
header_info() {
|
||||
clear
|
||||
cat <<EOF
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/refs/heads/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "update-apps" "tool"
|
||||
|
||||
# =============================================================================
|
||||
# CONFIGURATION VARIABLES
|
||||
@@ -100,14 +98,14 @@ EOF
|
||||
|
||||
# Handle command line arguments
|
||||
case "${1:-}" in
|
||||
--help | -h)
|
||||
print_usage
|
||||
exit 0
|
||||
;;
|
||||
--export-config)
|
||||
export_config_json
|
||||
exit 0
|
||||
;;
|
||||
--help|-h)
|
||||
print_usage
|
||||
exit 0
|
||||
;;
|
||||
--export-config)
|
||||
export_config_json
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# =============================================================================
|
||||
@@ -204,40 +202,40 @@ msg_ok "Loaded ${#menu_items[@]} containers"
|
||||
# Determine container selection based on var_container
|
||||
if [[ -n "$var_container" ]]; then
|
||||
case "$var_container" in
|
||||
all)
|
||||
# Select all containers with matching tags
|
||||
CHOICE=""
|
||||
for ((i = 0; i < ${#menu_items[@]}; i += 3)); do
|
||||
CHOICE="$CHOICE ${menu_items[$i]}"
|
||||
done
|
||||
CHOICE=$(echo "$CHOICE" | xargs)
|
||||
;;
|
||||
all_running)
|
||||
# Select only running containers with matching tags
|
||||
CHOICE=""
|
||||
for ((i = 0; i < ${#menu_items[@]}; i += 3)); do
|
||||
cid="${menu_items[$i]}"
|
||||
if pct status "$cid" 2>/dev/null | grep -q "running"; then
|
||||
CHOICE="$CHOICE $cid"
|
||||
fi
|
||||
done
|
||||
CHOICE=$(echo "$CHOICE" | xargs)
|
||||
;;
|
||||
all_stopped)
|
||||
# Select only stopped containers with matching tags
|
||||
CHOICE=""
|
||||
for ((i = 0; i < ${#menu_items[@]}; i += 3)); do
|
||||
cid="${menu_items[$i]}"
|
||||
if pct status "$cid" 2>/dev/null | grep -q "stopped"; then
|
||||
CHOICE="$CHOICE $cid"
|
||||
fi
|
||||
done
|
||||
CHOICE=$(echo "$CHOICE" | xargs)
|
||||
;;
|
||||
*)
|
||||
# Assume comma-separated list of container IDs
|
||||
CHOICE=$(echo "$var_container" | tr ',' ' ')
|
||||
;;
|
||||
all)
|
||||
# Select all containers with matching tags
|
||||
CHOICE=""
|
||||
for ((i=0; i<${#menu_items[@]}; i+=3)); do
|
||||
CHOICE="$CHOICE ${menu_items[$i]}"
|
||||
done
|
||||
CHOICE=$(echo "$CHOICE" | xargs)
|
||||
;;
|
||||
all_running)
|
||||
# Select only running containers with matching tags
|
||||
CHOICE=""
|
||||
for ((i=0; i<${#menu_items[@]}; i+=3)); do
|
||||
cid="${menu_items[$i]}"
|
||||
if pct status "$cid" 2>/dev/null | grep -q "running"; then
|
||||
CHOICE="$CHOICE $cid"
|
||||
fi
|
||||
done
|
||||
CHOICE=$(echo "$CHOICE" | xargs)
|
||||
;;
|
||||
all_stopped)
|
||||
# Select only stopped containers with matching tags
|
||||
CHOICE=""
|
||||
for ((i=0; i<${#menu_items[@]}; i+=3)); do
|
||||
cid="${menu_items[$i]}"
|
||||
if pct status "$cid" 2>/dev/null | grep -q "stopped"; then
|
||||
CHOICE="$CHOICE $cid"
|
||||
fi
|
||||
done
|
||||
CHOICE=$(echo "$CHOICE" | xargs)
|
||||
;;
|
||||
*)
|
||||
# Assume comma-separated list of container IDs
|
||||
CHOICE=$(echo "$var_container" | tr ',' ' ')
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -z "$CHOICE" ]]; then
|
||||
|
||||
@@ -24,11 +24,6 @@ RD=$(echo "\033[01;31m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "update-lxcs" "tool"
|
||||
|
||||
header_info
|
||||
echo "Loading..."
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE LXC Updater" --yesno "This Will Update LXC Containers. Proceed?" 10 58
|
||||
|
||||
@@ -23,10 +23,6 @@ RD=$(echo "\033[01;31m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
|
||||
# Telemetry
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "update-repo" "tool"
|
||||
|
||||
header_info
|
||||
echo "Loading..."
|
||||
NODE=$(hostname)
|
||||
|
||||
Reference in New Issue
Block a user