refactor(ct): migrate manual update backups to create_backup (batch 2)

Manually standardize 52 more update scripts with clear backup/restore
patterns, including multi-path and post-build restore timing where needed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
MickLesk
2026-06-19 23:42:12 +02:00
parent a1f4bc3240
commit 1b195cbd1c
52 changed files with 119 additions and 411 deletions
+2 -8
View File
@@ -30,16 +30,10 @@ function update_script() {
fi
if check_for_gh_release "cinny" "cinnyapp/cinny"; then
msg_info "Backing up Configuration"
cp /opt/cinny/config.json /opt/cinny_config.json.bak
msg_ok "Backed up Configuration"
create_backup /opt/cinny/config.json
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "cinny" "cinnyapp/cinny" "prebuild" "latest" "/opt/cinny" "cinny-*.tar.gz"
msg_info "Restoring Configuration"
cp /opt/cinny_config.json.bak /opt/cinny/config.json
rm -f /opt/cinny_config.json.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Restarting nginx"
$STD rc-service nginx restart
+2 -4
View File
@@ -33,15 +33,13 @@ function update_script() {
rc-service garage stop || true
msg_ok "Stopped Service"
msg_info "Backing Up Data"
cp /usr/local/bin/garage /usr/local/bin/garage.old 2>/dev/null || true
cp /etc/garage.toml /etc/garage.toml.bak 2>/dev/null || true
msg_ok "Backed Up Data"
create_backup /etc/garage.toml
msg_info "Updating Garage"
curl -fsSL "https://garagehq.deuxfleurs.fr/_releases/${GITEA_RELEASE}/$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl/garage" -o /usr/local/bin/garage
chmod +x /usr/local/bin/garage
echo "${GITEA_RELEASE}" >~/.garage
clear_update_backup
msg_ok "Updated Garage"
msg_info "Starting Service"
+2 -8
View File
@@ -33,18 +33,12 @@ function update_script() {
rc-service ironclaw stop 2>/dev/null || true
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /root/.ironclaw/.env /root/ironclaw.env.bak
msg_ok "Backed up Configuration"
create_backup /root/.ironclaw/.env
fetch_and_deploy_gh_release "ironclaw-bin" "nearai/ironclaw" "prebuild" "latest" "/usr/local/bin" \
"ironclaw-$(uname -m)-unknown-linux-musl.tar.gz"
chmod +x /usr/local/bin/ironclaw
msg_info "Restoring Configuration"
cp /root/ironclaw.env.bak /root/.ironclaw/.env
rm -f /root/ironclaw.env.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Starting Service"
rc-service ironclaw start
+4 -8
View File
@@ -34,10 +34,8 @@ function update_script() {
systemctl stop endurain
msg_ok "Stopped Service"
msg_info "Creating Backup"
cp /opt/endurain/.env /opt/endurain.env
cp /opt/endurain/frontend/app/dist/env.js /opt/endurain.env.js
msg_ok "Created Backup"
create_backup /opt/endurain/.env
[[ -f /opt/endurain/frontend/app/dist/env.js ]] && cp /opt/endurain/frontend/app/dist/env.js /opt/endurain.env.js
CLEAN_INSTALL=1 fetch_and_deploy_codeberg_release "endurain" "endurain-project/endurain" "tarball" "latest" "/opt/endurain"
@@ -47,16 +45,14 @@ function update_script() {
/opt/endurain/{docs,example.env,screenshot_01.png} \
/opt/endurain/docker* \
/opt/endurain/*.yml
cp /opt/endurain.env /opt/endurain/.env
rm /opt/endurain.env
restore_backup
msg_ok "Prepared Update"
msg_info "Updating Frontend"
cd /opt/endurain/frontend/app
$STD npm ci
$STD npm run build
cp /opt/endurain.env.js /opt/endurain/frontend/app/dist/env.js
rm /opt/endurain.env.js
[[ -f /opt/endurain.env.js ]] && cp /opt/endurain.env.js /opt/endurain/frontend/app/dist/env.js && rm -f /opt/endurain.env.js
msg_ok "Updated Frontend"
msg_info "Updating Backend"
+2 -13
View File
@@ -35,21 +35,10 @@ function update_script() {
systemctl stop nginx
msg_ok "Stopped Service"
if [[ -f /opt/fladder/assets/config/config.json ]]; then
msg_info "Backing up configuration"
cp /opt/fladder/assets/config/config.json /tmp/fladder_config.json.bak
msg_ok "Configuration backed up"
fi
create_backup /opt/fladder/assets/config/config.json
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Fladder" "DonutWare/Fladder" "prebuild" "latest" "/opt/fladder" "Fladder-Web-*.zip"
if [[ -f /tmp/fladder_config.json.bak ]]; then
msg_info "Restoring configuration"
mkdir -p /opt/fladder/assets/config
cp /tmp/fladder_config.json.bak /opt/fladder/assets/config/config.json
rm -f /tmp/fladder_config.json.bak
msg_ok "Configuration restored"
fi
restore_backup
msg_info "Starting Service"
systemctl start nginx
+2 -4
View File
@@ -34,15 +34,13 @@ function update_script() {
systemctl stop garage
msg_ok "Stopped Service"
msg_info "Backing Up Data"
cp /usr/local/bin/garage /usr/local/bin/garage.old 2>/dev/null || true
cp /etc/garage.toml /etc/garage.toml.bak 2>/dev/null || true
msg_ok "Backed Up Data"
create_backup /etc/garage.toml
msg_info "Updating Garage"
curl -fsSL "https://garagehq.deuxfleurs.fr/_releases/${GITEA_RELEASE}/x86_64-unknown-linux-musl/garage" -o /usr/local/bin/garage
chmod +x /usr/local/bin/garage
echo "${GITEA_RELEASE}" >~/.garage
clear_update_backup
msg_ok "Updated Garage"
msg_info "Starting Service"
+3 -2
View File
@@ -34,15 +34,16 @@ function update_script() {
systemctl stop gatus
msg_ok "Stopped Service"
mv /opt/gatus/config/config.yaml /opt
create_backup /opt/gatus/config/config.yaml
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "gatus" "TwiN/gatus" "tarball"
restore_backup
msg_info "Updating Gatus"
cd /opt/gatus
$STD go mod tidy
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
setcap CAP_NET_RAW+ep gatus
mv /opt/config.yaml config
msg_ok "Updated Gatus"
msg_info "Starting Service"
+2 -10
View File
@@ -37,21 +37,13 @@ function update_script() {
systemctl stop grist
msg_ok "Stopped Service"
msg_info "Creating backup"
rm -rf /opt/grist_bak
mv /opt/grist /opt/grist_bak
msg_ok "Backup created"
create_backup /opt/grist/.env /opt/grist/docs /opt/grist/grist-sessions.db /opt/grist/landing.db
fetch_and_deploy_gh_release "grist" "gristlabs/grist-core" "tarball"
restore_backup
msg_info "Updating Grist"
mkdir -p /opt/grist/docs
cp -n /opt/grist_bak/.env /opt/grist/.env
if ls /opt/grist_bak/docs/* &>/dev/null; then
cp -r /opt/grist_bak/docs/* /opt/grist/docs/
fi
[[ -f /opt/grist_bak/grist-sessions.db ]] && cp /opt/grist_bak/grist-sessions.db /opt/grist/grist-sessions.db
[[ -f /opt/grist_bak/landing.db ]] && cp /opt/grist_bak/landing.db /opt/grist/landing.db
cd /opt/grist
$STD yarn install
$STD yarn run build:prod
+2 -14
View File
@@ -35,22 +35,10 @@ function update_script() {
systemctl stop guardian-backend guardian-frontend
msg_ok "Stopped Services"
if [[ -f "/opt/guardian/backend/plex-guard.db" ]]; then
msg_info "Backing up Database"
cp "/opt/guardian/backend/plex-guard.db" "/tmp/plex-guard.db.backup"
msg_ok "Backed up Database"
fi
create_backup /opt/guardian/.env /opt/guardian/backend/plex-guard.db
[[ -f "/opt/guardian/.env" ]] && cp "/opt/guardian/.env" "/opt"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "guardian" "HydroshieldMKII/Guardian" "tarball" "latest" "/opt/guardian"
[[ -f "/opt/.env" ]] && mv "/opt/.env" "/opt/guardian"
if [[ -f "/tmp/plex-guard.db.backup" ]]; then
msg_info "Restoring Database"
cp "/tmp/plex-guard.db.backup" "/opt/guardian/backend/plex-guard.db"
rm "/tmp/plex-guard.db.backup"
msg_ok "Restored Database"
fi
restore_backup
msg_info "Updating Guardian"
cd /opt/guardian/backend
+2 -11
View File
@@ -34,19 +34,10 @@ function update_script() {
systemctl stop homer
msg_ok "Stopped Service"
msg_info "Backing up assets directory"
cd ~
mkdir -p assets-backup
cp -R /opt/homer/assets/. assets-backup
msg_ok "Backed up assets directory"
create_backup /opt/homer/assets
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "homer" "bastienwirtz/homer" "prebuild" "latest" "/opt/homer" "homer.zip"
msg_info "Restoring assets directory"
cd ~
cp -Rf assets-backup/. /opt/homer/assets/
rm -rf assets-backup
msg_ok "Restored assets directory"
restore_backup
msg_info "Starting Service"
systemctl start homer
+2 -8
View File
@@ -36,16 +36,10 @@ function update_script() {
systemctl stop hoodik
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /opt/hoodik/.env /opt/hoodik.env.bak
msg_ok "Backed up Configuration"
create_backup /opt/hoodik/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "hoodik" "hudikhq/hoodik" "prebuild" "latest" "/opt/hoodik" "*x86_64.tar.gz"
msg_info "Restoring Configuration"
cp /opt/hoodik.env.bak /opt/hoodik/.env
rm -f /opt/hoodik.env.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Starting Service"
systemctl start hoodik
+2 -8
View File
@@ -35,16 +35,10 @@ function update_script() {
systemctl stop igotify
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /opt/igotify/.env /opt/igotify.env.bak
msg_ok "Backed up Configuration"
create_backup /opt/igotify/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "igotify" "androidseb25/iGotify-Notification-Assistent" "prebuild" "latest" "/opt/igotify" "iGotify-Notification-Service-amd64-v*.zip"
msg_info "Restoring Configuration"
cp /opt/igotify.env.bak /opt/igotify/.env
rm -f /opt/igotify.env.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Starting Service"
systemctl start igotify
+2 -10
View File
@@ -41,20 +41,13 @@ function update_script() {
NODE_VERSION="22" setup_nodejs
PG_VERSION="17" setup_postgresql
msg_info "Creating Backup"
rm -f /opt/.env.backup
rm -rf /opt/investbrain_backup
cp /opt/investbrain/.env /opt/.env.backup
cp -r /opt/investbrain/storage /opt/investbrain_backup
msg_ok "Created Backup"
create_backup /opt/investbrain/.env /opt/investbrain/storage
fetch_and_deploy_gh_release "Investbrain" "investbrainapp/investbrain" "tarball" "latest" "/opt/investbrain"
restore_backup
msg_info "Updating Investbrain"
cd /opt/investbrain
rm -rf /opt/investbrain/storage
cp /opt/.env.backup /opt/investbrain/.env
cp -r /opt/investbrain_backup/ /opt/investbrain/storage
export COMPOSER_ALLOW_SUPERUSER=1
$STD /usr/local/bin/composer install --no-interaction --no-dev --optimize-autoloader
$STD npm install
@@ -69,7 +62,6 @@ function update_script() {
$STD php artisan event:cache
chown -R www-data:www-data /opt/investbrain
chmod -R 775 /opt/investbrain/storage /opt/investbrain/bootstrap/cache
rm -rf /opt/.env.backup /opt/investbrain_backup
msg_ok "Updated Investbrain"
msg_info "Starting Services"
+2 -8
View File
@@ -35,18 +35,12 @@ function update_script() {
systemctl stop ironclaw
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /root/.ironclaw/.env /root/ironclaw.env.bak
msg_ok "Backed up Configuration"
create_backup /root/.ironclaw/.env
fetch_and_deploy_gh_release "ironclaw-bin" "nearai/ironclaw" "prebuild" "latest" "/usr/local/bin" \
"ironclaw-$(uname -m)-unknown-linux-gnu.tar.gz"
chmod +x /usr/local/bin/ironclaw
msg_info "Restoring Configuration"
cp /root/ironclaw.env.bak /root/.ironclaw/.env
rm -f /root/ironclaw.env.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Starting Service"
systemctl start ironclaw
+2 -8
View File
@@ -35,16 +35,10 @@ function update_script() {
systemctl stop kan
msg_ok "Stopped Service"
msg_info "Backing up Data"
cp /opt/kan/.env /opt/kan.env.bak
msg_ok "Backed up Data"
create_backup /opt/kan/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_tag "kan" "kanbn/kan" "latest"
msg_info "Restoring Configuration"
cp /opt/kan.env.bak /opt/kan/.env
rm -f /opt/kan.env.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Building Application"
cd /opt/kan
+2 -4
View File
@@ -37,14 +37,12 @@ function update_script() {
systemctl stop kapowarr
msg_ok "Stopped Service"
msg_info "Creating Backup"
mv /opt/kapowarr/db /opt/
msg_ok "Backup Created"
create_backup /opt/kapowarr/db
fetch_and_deploy_gh_release "kapowarr" "Casvt/Kapowarr" "tarball"
restore_backup
msg_info "Updating Kapowarr"
mv /opt/db /opt/kapowarr
msg_ok "Updated Kapowarr"
msg_info "Starting Service"
+2 -10
View File
@@ -37,18 +37,10 @@ function update_script() {
systemctl stop kima-frontend kima-backend kima-analyzer kima-analyzer-clap
msg_ok "Stopped Services"
msg_info "Backing up Data"
cp /opt/kima-hub/backend/.env /opt/kima-hub-backend-env.bak
cp /opt/kima-hub/frontend/.env /opt/kima-hub-frontend-env.bak
msg_ok "Backed up Data"
create_backup /opt/kima-hub/backend/.env /opt/kima-hub/frontend/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "kima-hub" "Chevron7Locked/kima-hub" "tarball"
msg_info "Restoring Data"
cp /opt/kima-hub-backend-env.bak /opt/kima-hub/backend/.env
cp /opt/kima-hub-frontend-env.bak /opt/kima-hub/frontend/.env
rm -f /opt/kima-hub-backend-env.bak /opt/kima-hub-frontend-env.bak
msg_ok "Restored Data"
restore_backup
msg_info "Rebuilding Backend"
cd /opt/kima-hub/backend
+3 -12
View File
@@ -35,24 +35,15 @@ function update_script() {
systemctl stop kitchenowl
msg_ok "Stopped Service"
msg_info "Creating Backup"
mkdir -p /opt/kitchenowl_backup
cp -r /opt/kitchenowl/data /opt/kitchenowl_backup/
cp -f /opt/kitchenowl/kitchenowl.env /opt/kitchenowl_backup/
msg_ok "Created Backup"
create_backup /opt/kitchenowl/data /opt/kitchenowl/kitchenowl.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "kitchenowl" "TomBursch/kitchenowl" "tarball" "latest" "/opt/kitchenowl"
rm -rf /opt/kitchenowl/web
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "kitchenowl-web" "TomBursch/kitchenowl" "prebuild" "latest" "/opt/kitchenowl/web" "kitchenowl_Web.tar.gz"
msg_info "Restoring data"
sed -i 's/default=True/default=False/' /opt/kitchenowl/backend/wsgi.py
cp -r /opt/kitchenowl_backup/data /opt/kitchenowl/
cp -f /opt/kitchenowl_backup/kitchenowl.env /opt/kitchenowl/
rm -rf /opt/kitchenowl_backup
msg_ok "Restored data"
restore_backup
msg_info "Updating KitchenOwl"
sed -i 's/default=True/default=False/' /opt/kitchenowl/backend/wsgi.py
cd /opt/kitchenowl/backend
$STD uv sync --frozen
cd /opt/kitchenowl/backend
+4 -14
View File
@@ -35,9 +35,7 @@ function update_script() {
systemctl stop librechat rag-api
msg_ok "Stopped Services"
msg_info "Backing up Configuration"
cp /opt/librechat/.env /opt/librechat.env.bak
msg_ok "Backed up Configuration"
create_backup /opt/librechat/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_tag "librechat" "danny-avila/LibreChat"
@@ -52,10 +50,7 @@ function update_script() {
$STD npm cache clean --force
msg_ok "Built Frontend"
msg_info "Restoring Configuration"
cp /opt/librechat.env.bak /opt/librechat/.env
rm -f /opt/librechat.env.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Starting Services"
systemctl start rag-api librechat
@@ -68,9 +63,7 @@ function update_script() {
systemctl stop rag-api
msg_ok "Stopped RAG API"
msg_info "Backing up RAG API Configuration"
cp /opt/rag-api/.env /opt/rag-api.env.bak
msg_ok "Backed up RAG API Configuration"
create_backup /opt/rag-api/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rag-api" "danny-avila/rag_api" "tarball"
@@ -79,10 +72,7 @@ function update_script() {
$STD .venv/bin/pip install -r requirements.lite.txt
msg_ok "Updated RAG API Dependencies"
msg_info "Restoring RAG API Configuration"
cp /opt/rag-api.env.bak /opt/rag-api/.env
rm -f /opt/rag-api.env.bak
msg_ok "Restored RAG API Configuration"
restore_backup
msg_info "Starting RAG API"
systemctl start rag-api
+2 -8
View File
@@ -35,16 +35,10 @@ function update_script() {
systemctl stop lobehub
msg_ok "Stopped Services"
msg_info "Backing up Data"
cp /opt/lobehub/.env /opt/lobehub.env.bak
msg_ok "Backed up Data"
create_backup /opt/lobehub/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "lobehub" "lobehub/lobehub" "tarball"
msg_info "Restoring Configuration"
cp /opt/lobehub.env.bak /opt/lobehub/.env
rm -f /opt/lobehub.env.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Building Application"
cd /opt/lobehub
+2 -7
View File
@@ -34,20 +34,15 @@ function update_script() {
systemctl stop metabase
msg_info "Stopped Service"
msg_info "Creating backup"
mv /opt/metabase/.env /opt
msg_ok "Created backup"
create_backup /opt/metabase/.env
msg_info "Updating Metabase"
RELEASE=$(get_latest_github_release "metabase/metabase")
curl -fsSL "https://downloads.metabase.com/v${RELEASE}.x/metabase.jar" -o /opt/metabase/metabase.jar
echo $RELEASE >~/.metabase
restore_backup
msg_ok "Updated Metabase"
msg_info "Restoring backup"
mv /opt/.env /opt/metabase
msg_ok "Restored backup"
msg_info "Starting Service"
systemctl start metabase
msg_ok "Started Service"
+2 -6
View File
@@ -42,16 +42,13 @@ function update_script() {
systemctl stop apache2
msg_ok "Stopped Service"
msg_info "Creating backup"
mv /opt/monica/ /opt/monica-backup
msg_ok "Backup created"
create_backup /opt/monica/.env /opt/monica/storage
fetch_and_deploy_gh_release "monica" "monicahq/monica" "prebuild" "latest" "/opt/monica" "monica-v*.tar.bz2"
restore_backup
msg_info "Configuring monica"
cd /opt/monica/
cp -r /opt/monica-backup/.env /opt/monica
cp -r /opt/monica-backup/storage/* /opt/monica/storage/
$STD composer install --no-interaction --no-dev
$STD yarn config set ignore-engines true
$STD yarn install
@@ -59,7 +56,6 @@ function update_script() {
$STD php artisan monica:update --force
chown -R www-data:www-data /opt/monica
chmod -R 775 /opt/monica/storage
rm -r /opt/monica-backup
msg_ok "Configured monica"
msg_info "Starting Service"
+2 -7
View File
@@ -36,9 +36,7 @@ function update_script() {
systemctl stop neko
msg_ok "Stopped Service"
msg_info "Backing up Data"
cp /etc/neko/neko.yaml /opt/neko.yaml.bak
msg_ok "Backed up Data"
create_backup /etc/neko/neko.yaml
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "neko" "m1k1o/neko" "tarball"
@@ -56,10 +54,7 @@ function update_script() {
cp -r /opt/neko/server/bin/plugins/* /etc/neko/plugins/ 2>/dev/null || true
msg_ok "Built Server"
msg_info "Restoring Data"
cp /opt/neko.yaml.bak /etc/neko/neko.yaml
rm -f /opt/neko.yaml.bak
msg_ok "Restored Data"
restore_backup
msg_info "Starting Service"
systemctl start neko
+2 -7
View File
@@ -33,9 +33,7 @@ function update_script() {
fi
if check_for_gh_release "netboot-xyz" "netbootxyz/netboot.xyz"; then
msg_info "Backing up Configuration"
cp /var/www/html/boot.cfg /opt/netboot-xyz-boot.cfg.bak
msg_ok "Backed up Configuration"
create_backup /var/www/html/boot.cfg
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "netboot-xyz" "netbootxyz/netboot.xyz" "prebuild" "latest" "/var/www/html" "menus.tar.gz"
@@ -70,10 +68,7 @@ function update_script() {
USE_ORIGINAL_FILENAME=true fetch_and_deploy_gh_release "netboot-xyz-multiarch-img" "netbootxyz/netboot.xyz" "singlefile" "latest" "/var/www/html" "netboot.xyz-multiarch.img"
USE_ORIGINAL_FILENAME=true fetch_and_deploy_gh_release "netboot-xyz-checksums" "netbootxyz/netboot.xyz" "singlefile" "latest" "/var/www/html" "netboot.xyz-sha256-checksums.txt"
msg_info "Restoring Configuration"
cp /opt/netboot-xyz-boot.cfg.bak /var/www/html/boot.cfg
rm -f /opt/netboot-xyz-boot.cfg.bak
msg_ok "Restored Configuration"
restore_backup
msg_ok "Updated successfully!"
fi
+2 -7
View File
@@ -35,9 +35,7 @@ function update_script() {
systemctl stop nginx-ui
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /usr/local/etc/nginx-ui/app.ini /tmp/nginx-ui-app.ini.bak
msg_ok "Backed up Configuration"
create_backup /usr/local/etc/nginx-ui/app.ini
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "nginx-ui" "0xJacky/nginx-ui" "prebuild" "latest" "/opt/nginx-ui" "nginx-ui-linux-64.tar.gz"
@@ -45,12 +43,9 @@ function update_script() {
cp /opt/nginx-ui/nginx-ui /usr/local/bin/nginx-ui
chmod +x /usr/local/bin/nginx-ui
rm -rf /opt/nginx-ui
restore_backup
msg_ok "Updated Binary"
msg_info "Restoring Configuration"
mv /tmp/nginx-ui-app.ini.bak /usr/local/etc/nginx-ui/app.ini
msg_ok "Restored Configuration"
msg_info "Starting Service"
systemctl start nginx-ui
msg_ok "Started Service"
+2 -10
View File
@@ -33,19 +33,11 @@ function update_script() {
systemctl stop ombi
msg_ok "Stopped Service"
msg_info "Creating backup"
[[ -f /opt/ombi/Ombi.db ]] && mv /opt/ombi/Ombi.db /opt
[[ -f /opt/ombi/OmbiExternal.db ]] && mv /opt/ombi/OmbiExternal.db /opt
[[ -f /opt/ombi/OmbiSettings.db ]] && mv /opt/ombi/OmbiSettings.db /opt
[[ -f /opt/ombi/database.json ]] && mv /opt/ombi/database.json /opt
msg_ok "Backup created"
create_backup /opt/ombi/Ombi.db /opt/ombi/OmbiExternal.db /opt/ombi/OmbiSettings.db /opt/ombi/database.json
rm -rf /opt/ombi
fetch_and_deploy_gh_release "ombi" "Ombi-app/Ombi" "prebuild" "latest" "/opt/ombi" "linux-x64.tar.gz"
[[ -f /opt/Ombi.db ]] && mv /opt/Ombi.db /opt/ombi
[[ -f /opt/OmbiExternal.db ]] && mv /opt/OmbiExternal.db /opt/ombi
[[ -f /opt/OmbiSettings.db ]] && mv /opt/OmbiSettings.db /opt/ombi
[[ -f /opt/database.json ]] && mv /opt/database.json /opt/ombi
restore_backup
msg_info "Starting Service"
systemctl start ombi
+2 -7
View File
@@ -33,15 +33,10 @@ function update_script() {
systemctl stop opengist
msg_ok "Stopped Service"
msg_info "Creating backup"
mv /opt/opengist /opt/opengist-backup
msg_ok "Backup created"
create_backup /opt/opengist/config.yml
fetch_and_deploy_gh_release "opengist" "thomiceli/opengist" "prebuild" "latest" "/opt/opengist" "opengist*linux-amd64.tar.gz"
msg_info "Restoring Configuration"
mv /opt/opengist-backup/config.yml /opt/opengist/config.yml
msg_ok "Configuration Restored"
restore_backup
msg_info "Starting Service"
systemctl start opengist
+2 -4
View File
@@ -36,15 +36,13 @@ function update_script() {
systemctl stop outline
msg_ok "Services Stopped"
msg_info "Creating backup"
cp /opt/outline/.env /opt
msg_ok "Backup created"
create_backup /opt/outline/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "outline" "outline/outline" "tarball"
restore_backup
msg_info "Updating Outline"
cd /opt/outline
mv /opt/.env /opt/outline
export NODE_ENV=development
export NODE_OPTIONS="--max-old-space-size=3584"
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
+2 -5
View File
@@ -61,18 +61,15 @@ EOF
systemctl stop overseerr
msg_ok "Service stopped"
msg_info "Creating backup"
mv /opt/overseerr/config /opt/config_backup
msg_ok "Backup created"
create_backup /opt/overseerr/config
fetch_and_deploy_gh_release "overseerr" "sct/overseerr" "tarball"
rm -rf /opt/overseerr/config
msg_info "Configuring ${APP} (Patience)"
cd /opt/overseerr
$STD yarn install
$STD yarn build
mv /opt/config_backup /opt/overseerr/config
restore_backup
msg_ok "Configured ${APP}"
msg_info "Starting Service"
+2 -7
View File
@@ -35,15 +35,10 @@ function update_script() {
systemctl stop paperclip
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /opt/paperclip-ai/.env /opt/paperclip.env.bak
msg_ok "Backed up Configuration"
create_backup /opt/paperclip-ai/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "paperclip-ai" "paperclipai/paperclip" "tarball"
msg_info "Restoring Configuration"
mv /opt/paperclip.env.bak /opt/paperclip-ai/.env
msg_ok "Restored Configuration"
restore_backup
msg_info "Rebuilding Paperclip"
cd /opt/paperclip-ai
+3 -9
View File
@@ -35,11 +35,7 @@ function update_script() {
systemctl stop papra
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
if [[ -f /opt/papra/apps/papra-server/.env ]]; then
cp /opt/papra/apps/papra-server/.env /opt/papra_env.bak
fi
msg_ok "Backed up Configuration"
create_backup /opt/papra/apps/papra-server/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "papra" "papra-hq/papra" "tarball"
@@ -48,9 +44,8 @@ function update_script() {
msg_info "Building Application"
cd /opt/papra
if [[ -f /opt/papra_env.bak ]]; then
cp /opt/papra_env.bak /opt/papra/apps/papra-server/.env
else
restore_backup
if [[ ! -f /opt/papra/apps/papra-server/.env ]]; then
msg_warn ".env missing, regenerating from defaults"
LOCAL_IP=$(hostname -I | awk '{print $1}')
cat <<EOF >/opt/papra/apps/papra-server/.env
@@ -74,7 +69,6 @@ EOF
$STD pnpm --filter "@papra/app-client..." run build
$STD pnpm --filter "@papra/app-server..." run build
ln -sf /opt/papra/apps/papra-client/dist /opt/papra/apps/papra-server/public
rm -f /opt/papra_env.bak
msg_ok "Built Application"
msg_info "Starting Service"
+2 -7
View File
@@ -36,18 +36,13 @@ function update_script() {
msg_ok "Updated PowerDNS"
if check_for_gh_release "poweradmin" "poweradmin/poweradmin"; then
msg_info "Backing up Configuration"
cp /opt/poweradmin/config/settings.php /opt/poweradmin_settings.php.bak
cp /opt/poweradmin/powerdns.db /opt/poweradmin_powerdns.db.bak
msg_ok "Backed up Configuration"
create_backup /opt/poweradmin/config/settings.php /opt/poweradmin/powerdns.db
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "poweradmin" "poweradmin/poweradmin" "tarball"
restore_backup
msg_info "Updating Poweradmin"
cp /opt/poweradmin_settings.php.bak /opt/poweradmin/config/settings.php
cp /opt/poweradmin_powerdns.db.bak /opt/poweradmin/powerdns.db
rm -rf /opt/poweradmin/install
rm -f /opt/poweradmin_settings.php.bak /opt/poweradmin_powerdns.db.bak
chown -R www-data:pdns /opt/poweradmin
chmod 775 /opt/poweradmin
chown pdns:pdns /opt/poweradmin/powerdns.db
+2 -8
View File
@@ -34,16 +34,10 @@ function update_script() {
systemctl stop blackbox-exporter
msg_ok "Stopped Service"
msg_info "Creating backup"
mv /opt/blackbox-exporter/blackbox.yml /opt
msg_ok "Backup created"
create_backup /opt/blackbox-exporter/blackbox.yml
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "blackbox-exporter" "prometheus/blackbox_exporter" "prebuild" "latest" "/opt/blackbox-exporter" "blackbox_exporter-*.linux-amd64.tar.gz"
msg_info "Restoring backup"
cp -r /opt/blackbox.yml /opt/blackbox-exporter
rm -f /opt/blackbox.yml
msg_ok "Backup restored"
restore_backup
msg_info "Starting Service"
systemctl start blackbox-exporter
+3 -2
View File
@@ -36,7 +36,8 @@ function update_script() {
ensure_dependencies git
cp /opt/reactive-resume/.env /opt/reactive-resume.env.bak
create_backup /opt/reactive-resume/.env
NODE_VERSION="24" setup_nodejs
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "reactive-resume" "amruthpillai/reactive-resume" "tarball" "latest" "/opt/reactive-resume"
@@ -49,7 +50,7 @@ function update_script() {
export NODE_ENV="production"
$STD pnpm install --frozen-lockfile
$STD pnpm run build
mv /opt/reactive-resume.env.bak /opt/reactive-resume/.env
restore_backup
msg_ok "Updated Reactive Resume"
msg_info "Updating Service"
+2 -4
View File
@@ -37,14 +37,12 @@ function update_script() {
systemctl stop romm-backend romm-worker romm-scheduler romm-watcher
msg_ok "Stopped Services"
msg_info "Backing up configuration"
cp /opt/romm/.env /opt/romm/.env.backup
msg_ok "Backed up configuration"
create_backup /opt/romm/.env
fetch_and_deploy_gh_release "romm" "rommapp/romm" "tarball" "latest" "/opt/romm"
restore_backup
msg_info "Updating ROMM"
cp /opt/romm/.env.backup /opt/romm/.env
cd /opt/romm
$STD uv sync --all-extras
cd /opt/romm/backend
+2 -10
View File
@@ -35,18 +35,10 @@ function update_script() {
systemctl stop rustypaste
msg_ok "Stopped Services"
msg_info "Creating Backup"
tar -czf "/opt/rustypaste_backup_$(date +%F).tar.gz" /opt/rustypaste/upload 2>/dev/null || true
cp /opt/rustypaste/config.toml /tmp/rustypaste_config.toml.bak
msg_ok "Backup Created"
create_backup /opt/rustypaste/config.toml /opt/rustypaste/upload
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "prebuild" "latest" "/opt/rustypaste" "*x86_64-unknown-linux-gnu.tar.gz"
msg_info "Restoring Data"
mv /tmp/rustypaste_config.toml.bak /opt/rustypaste/config.toml
tar -xzf "/opt/rustypaste_backup_$(date +%F).tar.gz" -C /opt/rustypaste/upload 2>/dev/null || true
rm -rf /opt/rustypaste_backup_$(date +%F).tar.gz
msg_ok "Restored Data"
restore_backup
msg_info "Starting Services"
systemctl start rustypaste
+2 -7
View File
@@ -123,9 +123,7 @@ EOF
systemctl stop seerr
msg_ok "Stopped Service"
msg_info "Creating Backup"
cp -a /opt/seerr/config /opt/seerr_backup
msg_ok "Created Backup"
create_backup /opt/seerr/config
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "seerr" "seerr-team/seerr" "tarball"
@@ -145,10 +143,7 @@ EOF
$STD pnpm build
msg_ok "Updated Seerr"
msg_info "Restoring Backup"
rm -rf /opt/seerr/config
mv /opt/seerr_backup /opt/seerr/config
msg_ok "Restored Backup"
restore_backup
msg_info "Starting Service"
systemctl start seerr
+5 -15
View File
@@ -36,14 +36,10 @@ function update_script() {
[[ -f /etc/systemd/system/soularr.service ]] && systemctl stop soularr.timer soularr.service
msg_ok "Stopped Service(s)"
msg_info "Backing up config"
cp /opt/slskd/config/slskd.yml /opt/slskd.yml.bak
msg_ok "Backed up config"
create_backup /opt/slskd/config/slskd.yml
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Slskd" "slskd/slskd" "prebuild" "latest" "/opt/slskd" "slskd-*-linux-x64.zip"
msg_info "Restoring config"
mv /opt/slskd.yml.bak /opt/slskd/config/slskd.yml
restore_backup
# Migrate 0.25.0 breaking config key renames
sed -i 's/^global:/transfers:/' /opt/slskd/config/slskd.yml
@@ -63,13 +59,12 @@ function update_script() {
msg_ok "Stopped Timer and Service"
fi
msg_info "Backing up Soularr config"
cp /opt/soularr/config.ini /opt/soularr_config.ini.bak
cp /opt/soularr/run.sh /opt/soularr_run.sh.bak
msg_ok "Backed up Soularr config"
create_backup /opt/soularr/config.ini /opt/soularr/run.sh
PYTHON_VERSION="3.11" setup_uv
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Soularr" "mrusse/soularr" "tarball" "latest" "/opt/soularr"
restore_backup
msg_info "Updating Soularr"
cd /opt/soularr
$STD uv venv -c venv
@@ -78,11 +73,6 @@ function update_script() {
deactivate
msg_ok "Updated Soularr"
msg_info "Restoring Soularr config"
mv /opt/soularr_config.ini.bak /opt/soularr/config.ini
mv /opt/soularr_run.sh.bak /opt/soularr/run.sh
msg_ok "Restored Soularr config"
msg_info "Starting Soularr Timer"
systemctl restart soularr.timer
msg_ok "Started Soularr Timer"
+2 -4
View File
@@ -45,14 +45,12 @@ function update_script() {
$STD apt --only-upgrade install -y speedtest
msg_ok "Updated Speedtest CLI"
msg_info "Creating Backup"
cp -r /opt/speedtest-tracker /opt/speedtest-tracker-backup
msg_ok "Backup Created"
create_backup /opt/speedtest-tracker/.env
fetch_and_deploy_gh_release "speedtest-tracker" "alexjustesen/speedtest-tracker" "tarball" "latest" "/opt/speedtest-tracker"
restore_backup
msg_info "Updating Speedtest Tracker"
cp -r /opt/speedtest-tracker-backup/.env /opt/speedtest-tracker/.env
cd /opt/speedtest-tracker
export COMPOSER_ALLOW_SUPERUSER=1
$STD composer install --optimize-autoloader --no-dev
+2 -8
View File
@@ -35,16 +35,10 @@ function update_script() {
systemctl stop spliit
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
rm -f /opt/spliit.env.bak
cp /opt/spliit/.env /opt/spliit.env.bak
msg_ok "Backed up Configuration"
create_backup /opt/spliit/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "spliit" "spliit-app/spliit" "tarball"
msg_info "Restoring Configuration"
cp /opt/spliit.env.bak /opt/spliit/.env
msg_ok "Restored Configuration"
restore_backup
msg_info "Building Application"
cd /opt/spliit
+2 -7
View File
@@ -35,15 +35,10 @@ function update_script() {
systemctl stop storyteller
msg_ok "Stopped Service"
msg_info "Backing up Data"
cp /opt/storyteller/.env /opt/storyteller_env.bak
msg_ok "Backed up Data"
create_backup /opt/storyteller/.env
CLEAN_INSTALL=1 fetch_and_deploy_gl_release "storyteller" "storyteller-platform/storyteller" "tarball" "latest" "/opt/storyteller"
msg_info "Restoring Configuration"
mv /opt/storyteller_env.bak /opt/storyteller/.env
msg_ok "Restored Configuration"
restore_backup
msg_info "Rebuilding Storyteller"
cd /opt/storyteller
+2 -7
View File
@@ -36,15 +36,10 @@ function update_script() {
systemctl stop teable
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /opt/teable/.env /opt/teable.env.bak
msg_ok "Backed up Configuration"
create_backup /opt/teable/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "teable" "teableio/teable" "tarball"
msg_info "Restoring Configuration"
mv /opt/teable.env.bak /opt/teable/.env
msg_ok "Restored Configuration"
restore_backup
msg_info "Rebuilding Teable"
cd /opt/teable
+2 -8
View File
@@ -34,16 +34,10 @@ function update_script() {
systemctl stop teddycloud
msg_ok "Stopped Service"
msg_info "Creating backup"
mv /opt/teddycloud /opt/teddycloud_bak
msg_ok "Backup created"
create_backup /opt/teddycloud/certs /opt/teddycloud/config /opt/teddycloud/data
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "teddycloud" "toniebox-reverse-engineering/teddycloud" "prebuild" "latest" "/opt/teddycloud" "teddycloud.amd64.release*.zip"
msg_info "Restoring data"
cp -R /opt/teddycloud_bak/certs /opt/teddycloud_bak/config /opt/teddycloud_bak/data /opt/teddycloud
rm -rf /opt/teddycloud_bak
msg_ok "Data restored"
restore_backup
msg_info "Starting Service"
systemctl start teddycloud
+2 -10
View File
@@ -34,11 +34,7 @@ function update_script() {
systemctl stop traccar
msg_ok "Stopped Service"
msg_info "Creating backup"
mv /opt/traccar/conf/traccar.xml /opt
[[ -d /opt/traccar/data ]] && mv /opt/traccar/data /opt
[[ -d /opt/traccar/media ]] && mv /opt/traccar/media /opt
msg_ok "Backup created"
create_backup /opt/traccar/conf/traccar.xml /opt/traccar/data /opt/traccar/media
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "traccar" "traccar/traccar" "prebuild" "latest" "/opt/traccar" "traccar-linux-64*.zip"
@@ -47,12 +43,8 @@ function update_script() {
$STD ./traccar.run
msg_ok "App-Update completed"
msg_info "Restoring data"
mv /opt/traccar.xml /opt/traccar/conf
[[ -d /opt/data ]] && mv /opt/data /opt/traccar
[[ -d /opt/media ]] && mv /opt/media /opt/traccar
restore_backup
[ -f README.txt ] || [ -f traccar.run ] && rm -f README.txt traccar.run
msg_ok "Data restored"
msg_info "Starting Service"
systemctl start traccar
+2 -5
View File
@@ -35,9 +35,7 @@ function update_script() {
systemctl stop tubearchivist tubearchivist-celery tubearchivist-beat
msg_ok "Stopped Services"
msg_info "Backing up Data"
cp /opt/tubearchivist/.env /opt/tubearchivist_env.bak
msg_ok "Backed up Data"
create_backup /opt/tubearchivist/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "tubearchivist" "tubearchivist/tubearchivist" "tarball"
@@ -55,8 +53,7 @@ function update_script() {
fi
msg_ok "Rebuilt Tube Archivist"
msg_info "Restoring Configuration"
mv /opt/tubearchivist_env.bak /opt/tubearchivist/.env
restore_backup
sed -i 's|^TA_APP_DIR=/opt/tubearchivist$|TA_APP_DIR=/opt/tubearchivist/backend|' /opt/tubearchivist/.env
sed -i 's|^TA_CACHE_DIR=/opt/tubearchivist/cache$|TA_CACHE_DIR=/cache|' /opt/tubearchivist/.env
sed -i 's|^TA_MEDIA_DIR=/opt/tubearchivist/media$|TA_MEDIA_DIR=/youtube|' /opt/tubearchivist/.env
+2 -8
View File
@@ -38,16 +38,10 @@ function update_script() {
systemctl stop nginx php8.3-fpm
msg_ok "Stopped Services"
msg_info "Creating Backup"
cp /opt/wallabag/app/config/parameters.yml /tmp/wallabag_parameters.yml.bak
msg_ok "Created Backup"
create_backup /opt/wallabag/app/config/parameters.yml
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wallabag" "wallabag/wallabag" "prebuild" "latest" "/opt/wallabag" "wallabag-*.tar.gz"
msg_info "Restoring Configuration"
cp /tmp/wallabag_parameters.yml.bak /opt/wallabag/app/config/parameters.yml
rm -f /tmp/wallabag_parameters.yml.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Running Migrations"
cd /opt/wallabag
+2 -7
View File
@@ -30,18 +30,13 @@ function update_script() {
fi
if check_for_gh_release "wallos" "ellite/Wallos"; then
msg_info "Creating backup"
mkdir -p /opt/logos
mv /opt/wallos/db/wallos.db /opt/wallos.db
mv /opt/wallos/images/uploads/logos /opt/logos/
msg_ok "Backup created"
create_backup /opt/wallos/db/wallos.db /opt/wallos/images/uploads/logos
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "wallos" "ellite/Wallos" "tarball"
restore_backup
msg_info "Configuring Wallos"
rm -rf /opt/wallos/db/wallos.empty.db
mv /opt/wallos.db /opt/wallos/db/wallos.db
mv /opt/logos/* /opt/wallos/images/uploads/logos
if ! grep -q "storetotalyearlycost.php" /opt/wallos.cron; then
echo "30 1 * * 1 php /opt/wallos/endpoints/cronjobs/storetotalyearlycost.php >> /var/log/cron/storetotalyearlycost.log 2>&1" >>/opt/wallos.cron
fi
+5 -16
View File
@@ -34,27 +34,16 @@ function update_script() {
systemctl stop apache2
msg_ok "Services Stopped"
msg_info "Creating backup"
cp /opt/wavelog/application/config/config.php /opt/config.php
cp /opt/wavelog/application/config/database.php /opt/database.php
cp -r /opt/wavelog/userdata /opt/userdata
if [[ -f /opt/wavelog/assets/js/sections/custom.js ]]; then
cp /opt/wavelog/assets/js/sections/custom.js /opt/custom.js
fi
msg_ok "Backup created"
create_backup /opt/wavelog/application/config/config.php \
/opt/wavelog/application/config/database.php \
/opt/wavelog/userdata \
/opt/wavelog/assets/js/sections/custom.js
rm -rf /opt/wavelog
fetch_and_deploy_gh_release "wavelog" "wavelog/wavelog" "tarball"
restore_backup
msg_info "Updating Wavelog"
rm -rf /opt/wavelog/install
mv /opt/config.php /opt/wavelog/application/config/config.php
mv /opt/database.php /opt/wavelog/application/config/database.php
cp -r /opt/userdata/* /opt/wavelog/userdata
rm -rf /opt/userdata
if [[ -f /opt/custom.js ]]; then
mv /opt/custom.js /opt/wavelog/assets/js/sections/custom.js
fi
chown -R www-data:www-data /opt/wavelog/
find /opt/wavelog/ -type d -exec chmod 755 {} \;
find /opt/wavelog/ -type f -exec chmod 664 {} \;
+2 -11
View File
@@ -35,19 +35,10 @@ function update_script() {
systemctl stop writefreely
msg_ok "Stopped Services"
msg_info "Creating Backup"
mkdir -p /tmp/writefreely_backup
cp /opt/writefreely/keys /tmp/writefreely_backup/ 2>/dev/null
cp /opt/writefreely/config.ini /tmp/writefreely_backup/ 2>/dev/null
msg_ok "Created Backup"
create_backup /opt/writefreely/keys /opt/writefreely/config.ini
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "writefreely" "writefreely/writefreely" "prebuild" "latest" "/opt/writefreely" "writefreely_*_linux_amd64.tar.gz"
msg_info "Restoring Data"
cp /tmp/writefreely_backup/config.ini /opt/writefreely/ 2>/dev/null
cp /tmp/writefreely_backup/keys/* /opt/writefreely/keys/ 2>/dev/null
rm -rf /tmp/writefreely_backup
msg_ok "Restored Data"
restore_backup
msg_info "Running Post-Update Tasks"
cd /opt/writefreely
+2 -7
View File
@@ -36,9 +36,7 @@ function update_script() {
systemctl stop yamtrack yamtrack-celery
msg_ok "Stopped Services"
msg_info "Backing up Data"
cp /opt/yamtrack/src/.env /opt/yamtrack_env.bak
msg_ok "Backed up Data"
create_backup /opt/yamtrack/src/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "yamtrack" "FuzzyGrim/Yamtrack" "tarball"
@@ -47,10 +45,7 @@ function update_script() {
$STD uv sync --locked
msg_ok "Installed Python Dependencies"
msg_info "Restoring Data"
cp /opt/yamtrack_env.bak /opt/yamtrack/src/.env
rm -f /opt/yamtrack_env.bak
msg_ok "Restored Data"
restore_backup
msg_info "Updating Yamtrack"
cd /opt/yamtrack/src
+3 -8
View File
@@ -35,10 +35,8 @@ function update_script() {
systemctl stop zerobyte
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /opt/zerobyte/.env /opt/zerobyte.env.bak
msg_ok "Backed up Configuration"
create_backup /opt/zerobyte/.env
ensure_dependencies git
NODE_VERSION="24" setup_nodejs
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "zerobyte" "nicotsx/zerobyte" "tarball"
@@ -50,10 +48,7 @@ function update_script() {
$STD node ./node_modules/vite/bin/vite.js build
msg_ok "Built Zerobyte"
msg_info "Restoring Configuration"
cp /opt/zerobyte.env.bak /opt/zerobyte/.env
rm -f /opt/zerobyte.env.bak
msg_ok "Restored Configuration"
restore_backup
msg_info "Starting Service"
systemctl start zerobyte
+2 -4
View File
@@ -42,19 +42,17 @@ function update_script() {
BACKUP_FILE="/opt/backups/${APP}_backup_${BACKUP_VERSION}.tar.zst"
$STD tar -cf - -C /opt zigbee2mqtt | zstd -q -o "$BACKUP_FILE"
ls -t /opt/backups/${APP}_backup_*.tar.zst 2>/dev/null | tail -n +6 | xargs -r rm -f
mv /opt/zigbee2mqtt/data /opt/z2m_backup/data
create_backup /opt/zigbee2mqtt/data
msg_ok "Backup Created (${BACKUP_VERSION})"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Zigbee2MQTT" "Koenkk/zigbee2mqtt" "tarball" "latest" "/opt/zigbee2mqtt"
restore_backup
msg_info "Updating Zigbee2MQTT"
rm -rf /opt/zigbee2mqtt/data
mv /opt/z2m_backup/data /opt/zigbee2mqtt
cd /opt/zigbee2mqtt
grep -q "^packageImportMethod" ./pnpm-workspace.yaml 2>/dev/null || echo "packageImportMethod: hardlink" >>./pnpm-workspace.yaml
$STD pnpm install --frozen-lockfile
$STD pnpm build
rm -rf /opt/z2m_backup
msg_ok "Updated Zigbee2MQTT"
msg_info "Starting Service"