diff --git a/01-migrate-user.sh b/01-migrate-user.sh index 70565e1..eb1d8d8 100644 --- a/01-migrate-user.sh +++ b/01-migrate-user.sh @@ -15,6 +15,7 @@ BACKUP_DIR="$HOME/.wg-migration" LOG="$BACKUP_DIR/migration.log" REPO_URL="git@git.simplifiedprivacy.com:zenaku/operator-docker.git" OPERATOR_DIR="$HOME/operator-docker" +USER_HOME="$HOME" ok() { echo -e "${GREEN}[OK]${RESET} $1"; echo "[OK] $1" >> "$LOG"; } info() { echo -e "${CYAN}[i]${RESET} $1"; echo "[i] $1" >> "$LOG"; } @@ -184,7 +185,9 @@ echo "" cd "$OPERATOR_DIR" sudo systemctl start nginx 2>/dev/null || true -sudo MIGRATION_MODE=1 bash install.sh || fail "Installer failed. Check output above." +echo "$USER_HOME" > /tmp/.migration_home +sudo MIGRATION_MODE=1 bash install.sh || { rm -f /tmp/.migration_home; fail "Installer failed. Check output above."; } +rm -f /tmp/.migration_home if _env_is_corrupt "$OPERATOR_DIR/.env"; then fail "install.sh finished but generated an invalid .env. Check install.sh." @@ -242,3 +245,5 @@ echo " Installation complete" echo " Next: bash 02-migrate-peers.sh" echo "=========================================" echo "" +SCRIPT +echo "done"