mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-19 16:27:30 +08:00
fix install.sh
This commit is contained in:
16
install.sh
16
install.sh
@@ -130,7 +130,8 @@ if [[ "$MIGRATE" == "y" || "$MIGRATE" == "Y" ]]; then
|
|||||||
echo "2. Remote migration"
|
echo "2. Remote migration"
|
||||||
read -p "Enter your choice (1 or 2): " MIGRATION_TYPE
|
read -p "Enter your choice (1 or 2): " MIGRATION_TYPE
|
||||||
|
|
||||||
if [[ "$MIGRATION_TYPE" == "1" ]]; then
|
case "$MIGRATION_TYPE" in
|
||||||
|
1)
|
||||||
echo "Proceeding with local migration..."
|
echo "Proceeding with local migration..."
|
||||||
|
|
||||||
# Default paths for local migration
|
# Default paths for local migration
|
||||||
@@ -196,8 +197,8 @@ if [[ "$MIGRATE" == "y" || "$MIGRATE" == "Y" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[DONE] migration complete"
|
echo "[DONE] migration complete"
|
||||||
|
;;
|
||||||
elif [[ "$MIGRATION_TYPE" == "2" ]]; then
|
2)
|
||||||
echo "Proceeding with remote migration..."
|
echo "Proceeding with remote migration..."
|
||||||
|
|
||||||
read -p "Enter remote host (e.g., user@hostname): " REMOTE_HOST
|
read -p "Enter remote host (e.g., user@hostname): " REMOTE_HOST
|
||||||
@@ -208,7 +209,7 @@ if [[ "$MIGRATE" == "y" || "$MIGRATE" == "Y" ]]; then
|
|||||||
|
|
||||||
# Create a temporary SSH key for non-interactive SSH authentication (assuming sshpass is installed)
|
# Create a temporary SSH key for non-interactive SSH authentication (assuming sshpass is installed)
|
||||||
SSH_KEY=$(mktemp)
|
SSH_KEY=$(mktemp)
|
||||||
sshpass -p "$REMOTE_PASS" ssh-copy-id -i "$SSH_KEY" "$REMOTE_HOST -p $REMOTE_PORT"
|
sshpass -p "$REMOTE_PASS" ssh-copy-id -i "$SSH_KEY" -p "$REMOTE_PORT" "$REMOTE_HOST"
|
||||||
|
|
||||||
# Prepare migration script
|
# Prepare migration script
|
||||||
MIGRATION_SCRIPT="$TMPDIR/openclaw2clawgo.sh"
|
MIGRATION_SCRIPT="$TMPDIR/openclaw2clawgo.sh"
|
||||||
@@ -261,10 +262,11 @@ EOF
|
|||||||
sshpass -p "$REMOTE_PASS" ssh -p "$REMOTE_PORT" "$REMOTE_HOST" "bash /tmp/openclaw2clawgo.sh"
|
sshpass -p "$REMOTE_PASS" ssh -p "$REMOTE_PORT" "$REMOTE_HOST" "bash /tmp/openclaw2clawgo.sh"
|
||||||
|
|
||||||
echo "[INFO] Remote migration completed."
|
echo "[INFO] Remote migration completed."
|
||||||
|
;;
|
||||||
else
|
*)
|
||||||
echo "Invalid choice. Skipping migration."
|
echo "Invalid choice. Skipping migration."
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
|
|||||||
Reference in New Issue
Block a user