#!/bin/bash # Synod trial: three writers on this machine. # curl -fsSL https://synoddb.com/try.sh | sudo bash # Downloads the trial package (106 MB), checks its SHA-256, unpacks it into /opt/synod-trial # and runs synod-try there, which installs Synod on this machine and creates a cluster with three # writers. Ubuntu 24.04 on x86-64 with systemd, 8 GB of memory or more, as root. # Arguments go to synod-try: curl -fsSL https://synoddb.com/try.sh | sudo bash -s -- status # Read first if you like: curl -fsSL https://synoddb.com/try.sh | less set -euo pipefail VERSION=0.1.0 SHA256=fd54331eb60eeb8ca1395174cc22c0df3338892ee5c983486ffb914623f1470b URL=https://synoddb.com/download/synod-trial-$VERSION-ubuntu24.04-x86_64.tar.gz DIR=/opt/synod-trial [ "$(id -u)" = 0 ] || { echo "run as root: curl -fsSL https://synoddb.com/try.sh | sudo bash" >&2; exit 1; } [ "$(uname -m)" = x86_64 ] || { echo "Synod's trial is built for x86-64 (this machine: $(uname -m))" >&2; exit 1; } grep -q '^VERSION_ID="24.04"' /etc/os-release 2>/dev/null || { echo "Synod's trial is built for Ubuntu 24.04" >&2; exit 1; } for t in curl tar sha256sum python3; do command -v $t > /dev/null || { echo "missing $t" >&2; exit 1; }; done echo "Synod $VERSION trial: a prototype, free to try, provided as-is; no production data please." echo "Using it means you accept the trial terms: https://synoddb.com/download/TRIAL-TERMS.txt" if [ -x "$DIR/synod-try" ] && [ "$(head -1 "$DIR/VERSION" 2>/dev/null)" = "$VERSION" ]; then echo "Synod $VERSION is already unpacked in $DIR" else tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT echo "Downloading $URL" curl -fSL --progress-bar "$URL" -o "$tmp/synod-trial.tar.gz" echo "$SHA256 $tmp/synod-trial.tar.gz" | sha256sum -c --quiet - || { echo "checksum mismatch: not installing" >&2; exit 1; } rm -rf "$DIR" mkdir -p "$DIR" tar -xzf "$tmp/synod-trial.tar.gz" -C "$DIR" --strip-components=1 --no-same-owner echo "Unpacked into $DIR (README.md, TRIAL-TERMS.txt, LICENSES/)" fi exec python3 "$DIR/synod-try" "$@" < /dev/null