mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-12-01 20:38:19 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
612ea6e73c |
No files matched your search
+1
-6
@@ -30,18 +30,13 @@ function update_script() {
|
||||
ensure_dependencies build-essential
|
||||
|
||||
if command -v cross-seed &>/dev/null; then
|
||||
current_version=$(node -p "require('$(npm root -g)/cross-seed/package.json').version")
|
||||
current_version=$(cross-seed --version)
|
||||
latest_version=$(npm show cross-seed version)
|
||||
if [ "$current_version" != "$latest_version" ]; then
|
||||
msg_info "Updating cross-seed from version v${current_version} to v${latest_version}"
|
||||
$STD npm install -g cross-seed@latest
|
||||
systemctl restart cross-seed
|
||||
msg_ok "Updated successfully!"
|
||||
elif ! cross-seed --version &>/dev/null; then
|
||||
msg_info "Reinstalling cross-seed v${current_version} for Node.js $(node -v)"
|
||||
$STD npm install -g "cross-seed@${current_version}"
|
||||
systemctl restart cross-seed
|
||||
msg_ok "Reinstalled cross-seed"
|
||||
else
|
||||
msg_ok "cross-seed is already at v${current_version}"
|
||||
fi
|
||||
|
||||
+45
-1
@@ -117,9 +117,52 @@ EOF
|
||||
msg_ok "Compiled and Installed Comskip"
|
||||
fi
|
||||
|
||||
if ! grep -qs -- "-Q celery,plugins" /opt/dispatcharr/start-celery.sh; then
|
||||
msg_info "Migrating Celery Workers"
|
||||
cat <<'EOF' >/opt/dispatcharr/start-celery.sh
|
||||
#!/usr/bin/env bash
|
||||
cd /opt/dispatcharr
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
exec uv run celery -A dispatcharr worker -l info -Q celery,plugins -n default@%h --autoscale="${CELERY_MAX_WORKERS:-6},${CELERY_MIN_WORKERS:-1}"
|
||||
EOF
|
||||
cat <<'EOF' >/opt/dispatcharr/start-celery-dvr.sh
|
||||
#!/usr/bin/env bash
|
||||
cd /opt/dispatcharr
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
exec uv run celery -A dispatcharr worker -l info -Q dvr -n dvr@%h --pool=threads --concurrency=20
|
||||
EOF
|
||||
chmod +x /opt/dispatcharr/start-celery.sh /opt/dispatcharr/start-celery-dvr.sh
|
||||
cat <<EOF >/etc/systemd/system/dispatcharr-celery-dvr.service
|
||||
[Unit]
|
||||
Description=Dispatcharr Celery DVR Worker
|
||||
After=network.target redis-server.service
|
||||
Requires=dispatcharr.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/dispatcharr
|
||||
ExecStart=/opt/dispatcharr/start-celery-dvr.sh
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now dispatcharr-celery-dvr
|
||||
systemctl restart dispatcharr-celery
|
||||
msg_ok "Migrated Celery Workers"
|
||||
fi
|
||||
|
||||
if check_for_gh_release "Dispatcharr" "Dispatcharr/Dispatcharr"; then
|
||||
msg_info "Stopping Services"
|
||||
systemctl stop dispatcharr-celery
|
||||
systemctl stop dispatcharr-celery-dvr
|
||||
systemctl stop dispatcharr-celerybeat
|
||||
systemctl stop dispatcharr-daphne
|
||||
systemctl stop dispatcharr
|
||||
@@ -130,7 +173,7 @@ EOF
|
||||
if [[ -f /opt/dispatcharr/start-gunicorn.sh ]]; then
|
||||
rm -f /opt/dispatcharr/start-gunicorn.sh
|
||||
fi
|
||||
create_backup /opt/dispatcharr/.env /opt/dispatcharr/start-celery.sh /opt/dispatcharr/start-celerybeat.sh /opt/dispatcharr/start-daphne.sh
|
||||
create_backup /opt/dispatcharr/.env /opt/dispatcharr/start-celery.sh /opt/dispatcharr/start-celery-dvr.sh /opt/dispatcharr/start-celerybeat.sh /opt/dispatcharr/start-daphne.sh
|
||||
if [[ -f /opt/dispatcharr/.env ]]; then
|
||||
set -o allexport
|
||||
source /opt/dispatcharr/.env
|
||||
@@ -213,6 +256,7 @@ EOF
|
||||
msg_info "Starting Services"
|
||||
systemctl start dispatcharr
|
||||
systemctl start dispatcharr-celery
|
||||
systemctl start dispatcharr-celery-dvr
|
||||
systemctl start dispatcharr-celerybeat
|
||||
systemctl start dispatcharr-daphne
|
||||
msg_ok "Started Services"
|
||||
|
||||
@@ -185,16 +185,26 @@ exec .venv/bin/uwsgi \\
|
||||
EOF
|
||||
chmod +x /opt/dispatcharr/start-uwsgi.sh
|
||||
|
||||
cat <<EOF >/opt/dispatcharr/start-celery.sh
|
||||
cat <<'EOF' >/opt/dispatcharr/start-celery.sh
|
||||
#!/usr/bin/env bash
|
||||
cd /opt/dispatcharr
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
exec uv run celery -A dispatcharr worker -l info -c 4 -Q celery,recordings,dvr,default
|
||||
exec uv run celery -A dispatcharr worker -l info -Q celery,plugins -n default@%h --autoscale="${CELERY_MAX_WORKERS:-6},${CELERY_MIN_WORKERS:-1}"
|
||||
EOF
|
||||
chmod +x /opt/dispatcharr/start-celery.sh
|
||||
|
||||
cat <<'EOF' >/opt/dispatcharr/start-celery-dvr.sh
|
||||
#!/usr/bin/env bash
|
||||
cd /opt/dispatcharr
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
exec uv run celery -A dispatcharr worker -l info -Q dvr -n dvr@%h --pool=threads --concurrency=20
|
||||
EOF
|
||||
chmod +x /opt/dispatcharr/start-celery-dvr.sh
|
||||
|
||||
cat <<EOF >/opt/dispatcharr/start-celerybeat.sh
|
||||
#!/usr/bin/env bash
|
||||
cd /opt/dispatcharr
|
||||
@@ -250,6 +260,24 @@ User=root
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/systemd/system/dispatcharr-celery-dvr.service
|
||||
[Unit]
|
||||
Description=Dispatcharr Celery DVR Worker
|
||||
After=network.target redis-server.service
|
||||
Requires=dispatcharr.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/dispatcharr
|
||||
ExecStart=/opt/dispatcharr/start-celery-dvr.sh
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/systemd/system/dispatcharr-celerybeat.service
|
||||
[Unit]
|
||||
Description=Dispatcharr Celery Beat Scheduler
|
||||
@@ -285,7 +313,7 @@ User=root
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now dispatcharr dispatcharr-celery dispatcharr-celerybeat dispatcharr-daphne
|
||||
systemctl enable -q --now dispatcharr dispatcharr-celery dispatcharr-celery-dvr dispatcharr-celerybeat dispatcharr-daphne
|
||||
msg_ok "Created Services"
|
||||
|
||||
motd_ssh
|
||||
|
||||
Reference in new issue
Block a user