#!/usr/bin/env bash # grokBrain kit: download, verify (SHA-256) and run the installer. # curl -fsSL https://grokbrain-kit.pages.dev/get.sh | bash # curl -fsSL https://grokbrain-kit.pages.dev/get.sh | bash -s -- --answers answers.json --yes set -euo pipefail V="0.2.0" BASE="${GROKBRAIN_KIT_BASE:-https://grokbrain-kit.pages.dev}" DIR="${GROKBRAIN_KIT_DIR:-$HOME/grokbrain-kit}" ZIP="grokbrain-kit-$V.zip" mkdir -p "$DIR" && cd "$DIR" echo "Downloading grokBrain kit $V into $DIR" curl -fsSL "$BASE/$ZIP" -o "$ZIP" curl -fsSL "$BASE/SHA256SUMS" -o SHA256SUMS want="$(awk -v f="$ZIP" '$2==f {print $1}' SHA256SUMS)" if command -v sha256sum >/dev/null 2>&1; then got="$(sha256sum "$ZIP" | awk '{print $1}')" else got="$(shasum -a 256 "$ZIP" | awk '{print $1}')"; fi if [ -z "$want" ] || [ "$want" != "$got" ]; then echo "Checksum mismatch, not installing." >&2; exit 1; fi echo "Checksum OK ($got)" rm -rf "grokbrain-kit-$V" if command -v unzip >/dev/null 2>&1; then unzip -q "$ZIP"; else python3 -m zipfile -e "$ZIP" .; fi chmod +x "grokbrain-kit-$V"/*.sh cd "grokbrain-kit-$V" if (exec /dev/null; then exec bash install.sh "$@"