32 lines
823 B
Bash
Executable File
32 lines
823 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Prompt for CryoSPARC email
|
|
read -rp "Enter your CryoSPARC email (e.g. your_email@psi.ch): " CRYO_EMAIL
|
|
|
|
# Prompt for new password (hidden input)
|
|
read -rsp "Enter your new CryoSPARC password: " CRYO_PASSWORD
|
|
echo
|
|
|
|
# Confirm before executing
|
|
echo "Resetting CryoSPARC password for: $CRYO_EMAIL"
|
|
read -rp "Are you sure you want to proceed? [y/N]: " confirm
|
|
case "$confirm" in
|
|
[yY][eE][sS]|[yY])
|
|
;;
|
|
*)
|
|
echo "Operation cancelled."
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# Run the reset command over SSH
|
|
ssh "$USER@merlin7-cryosparc01.psi.ch" \
|
|
"cryosparcm resetpassword --email '$CRYO_EMAIL' --password '$CRYO_PASSWORD'"
|
|
|
|
# Check result
|
|
if [ $? -eq 0 ]; then
|
|
echo "✅ Password reset successfully."
|
|
else
|
|
echo "❌ Failed to reset password. Please check your inputs and try again."
|
|
fi
|