#!/bin/bash set -euo pipefail source ./_common.sh if [ -f "$YNH_BACKUP_DIR/albumik-data.tar.gz" ]; then tar -C / -xzf "$YNH_BACKUP_DIR/albumik-data.tar.gz" fi if [ -f "$YNH_BACKUP_DIR/$app.service" ]; then cp "$YNH_BACKUP_DIR/$app.service" "$service_file" fi if ! id "$app" >/dev/null 2>&1; then useradd --system --home "$install_dir" --shell /usr/sbin/nologin "$app" fi chown -R "$app:$app" "$install_dir" "$data_dir" "$config_dir" 2>/dev/null || true systemctl daemon-reload systemctl enable --now "$app" systemctl reload nginx || true echo "Albumik restored"