#!/bin/bash # # > make a file executable # chmod +x ./install.sh set -e DEFAULT_DIRNAME="$HOME/suno" TEMPDIR=$(mktemp -d) cleanup() { rm -rf "$TEMPDIR" } trap cleanup EXIT # # SUNO binary Installation Steps: # # 1. Check user architecture # 2. Ask user for installation path # 3. Fetch the latest version from GitHub releases # 4. Download and install suno # read -p "> Enter SUNO installation path [default: $DEFAULT_DIRNAME]: " DIRNAME /dev/null; then CHECK_CMD="shasum -a 256"; fi if $CHECK_CMD -c "$TARBALL_FILENAME_SHA256" 2>&1 | grep -q 'OK'; then echo "✔︎ Checksum verified" mkdir -p "$DIRNAME" # Backup existing binary FILENAME="$DIRNAME/suno" if [[ -f "$FILENAME" ]]; then mv "$FILENAME" "$FILENAME.backup" echo "✔︎ Existing binary backed up to $FILENAME.backup" fi # Extract the tarball tar xzf $TEMPDIR/$TARBALL_FILENAME suno echo "✔︎ Checking if suno exists: $(ls -l)" if [[ ! -f suno ]]; then echo "ERROR: Binary suno does not exist"; exit 1 fi # Install suno at $DIRNAME´ install -m 755 suno "$FILENAME" echo "✔︎ Successfully installed suno $LATEST_VERSION at $FILENAME" else echo "ERROR: SHA256 checksum verification failed"; fi # Configuration Installation Steps: # # 1. Ask user if wants to install # 2. Install a default configuration template if the user accepts # DEFAULT_CONFIG="$DIRNAME/.config.yaml" read -p "> Would you like to install the DEFAULT configuration file? [y/N]: " INSTALL_CONFIG Enter the configuration path [default: $DEFAULT_CONFIG]: " CONFIG "$CONFIG" chains: - polkadot: rpc_url: "ws://10.10.10.1:9944" validators: - "5GTD7ZeD823BjpmZBCSzBQp7cvHR1Gunq7oDkurZr9zUev2n" - asset_hub_polkadot: rpc_url: "ws://10.10.10.2:9944" - people_polkadot: rpc_url: "ws://10.10.10.3:9944" features: enable_validators: true # Builtin themes: ["Suno Dark", "Suno Light"] themes: active: "Suno Dark" path: "./themes" # Uncomment to use a signer proxy # signer: # proxy_path: ".proxy_account.json" explorer: url: "https://polkadot.js.org/apps/?rpc=wss://{chain}.rpc.turboflakes.io#/explorer/query/{block_hash}" # NOTE: Other explorers # url: "https://dev.papi.how/explorer/{block_hash}#networkId=localhost&endpoint=wss://{chain}.rpc.turboflakes.io" # url: "https://polkadot.chainconsole.com/apps/?rpc=wss://{chain}.rpc.turboflakes.io#/explorer/query/{block_hash}" EOF echo "✔︎ Config file saved at $CONFIG. "; echo "==> Next edit the config file and replace STASHES and RPC endpoints as you wish."; else echo "✔︎ Config file $CONFIG already exists. Configuration skipped"; fi else echo "✔︎ Configuration skipped"; fi echo "✔︎ Installation complete"; echo "— Enjoy suno $LATEST_VERSION";