Files
NexusOS/bin/restore-full.sh
T
jon a5ed5a3655 restore-full.sh: run install-theme.sh after restore
Mirrors the theme-restore step already in restore.sh, so the lftp
full-restore path also rebuilds the desktop wiring.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 13:45:38 -05:00

47 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
NEXUS_ROOT="$HOME/nexus-core"
detect_requirements() {
if command -v nvidia-smi &>/dev/null || lspci 2>/dev/null | grep -qi nvidia; then
echo "nvidia_requirements.txt"
else
echo "amd_requirements.txt"
fi
}
echo "Restoring full Nexus backup from router..."
lftp sftp://router:2022 << 'LFTP'
set sftp:connect-program "ssh -a -x -p 2022"
set cmd:interactive yes
mirror --delete --verbose --dereference --exclude "^Promethean/" --exclude "^models/blobs/" --exclude "^ollama/" --exclude "^interface/web/node_modules/" --exclude "^interface/web/dist/" --exclude "^runtime/" --exclude "__pycache__" --exclude "\.pyc$" /Wingdrive2/nexus-backup /home/jon/nexus-core
quit
LFTP
echo ""
echo "Rebuilding Python environment..."
req=$(detect_requirements)
if [ -f "$NEXUS_ROOT/$req" ]; then
"$NEXUS_ROOT/Promethean/bin/pip" install -r "$NEXUS_ROOT/$req"
else
echo "Warning: $req not found — skipping pip install."
fi
echo ""
echo "Rebuilding frontend dependencies..."
cd "$NEXUS_ROOT/interface/web" && npm install
echo ""
echo "Restoring NexusOS desktop theme..."
theme_installer="$NEXUS_ROOT/assets/themes/install-theme.sh"
if [ -x "$theme_installer" ]; then
"$theme_installer"
elif [ -f "$theme_installer" ]; then
bash "$theme_installer"
else
echo "Warning: $theme_installer not found — skipping theme restore."
fi
echo ""
echo "Restore complete. Nexus is ready to start."