39 lines
1.2 KiB
Bash
Executable File
39 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Set CryoSPARC installation directory
|
|
CRYOSPARC_HOME="/data/user/$USER/cryosparc"
|
|
|
|
# Check CRYOSPARC_HOME
|
|
if [ -z "$CRYOSPARC_HOME" ]; then
|
|
echo "Error: CRYOSPARC_HOME is not set."
|
|
return 1
|
|
fi
|
|
|
|
cd "$CRYOSPARC_HOME" || { echo "Failed to enter directory $CRYOSPARC_HOME"; return 1; }
|
|
|
|
# Check license ID
|
|
if [ -z "$CRYOSPARC_LICENSE_ID" ]; then
|
|
read -rp "Enter your CryoSPARC License ID: " CRYOSPARC_LICENSE_ID
|
|
if [ -z "$CRYOSPARC_LICENSE_ID" ]; then
|
|
echo "Error: License ID is required."
|
|
return 1
|
|
fi
|
|
fi
|
|
|
|
echo "Downloading CryoSPARC worker package..."
|
|
curl -L -o cryosparc_worker.tar.gz "https://get.cryosparc.com/download/worker-latest/$CRYOSPARC_LICENSE_ID"
|
|
if [ $? -ne 0 ]; then
|
|
echo "Download failed. Please check your license ID and internet connection."
|
|
return 1
|
|
fi
|
|
|
|
echo "Extracting CryoSPARC worker package..."
|
|
tar -xf cryosparc_worker.tar.gz || { echo "Failed to extract package."; return 1; }
|
|
rm cryosparc_worker.tar.gz
|
|
echo "Extraction complete."
|
|
|
|
cd cryosparc_worker || { echo "Failed to enter cryosparc_worker directory"; return 1; }
|
|
|
|
echo "Running CryoSPARC worker installer..."
|
|
./install.sh --license "$CRYOSPARC_LICENSE_ID"
|