#!/bin/sh # Installer for the 127ohoh1 CLI, release 2026.09.30-9689cb3 (2026-09-30T22:39:36Z), # generated by https://127ohoh1.com from its signed release manifest. # # curl -fsSL https://127ohoh1.com/install.sh | sh # # It picks the build for this machine, downloads it from https://127ohoh1.com and # installs it only if its SHA-256 matches the manifest. INSTALL_DIR overrides # the target directory (default: /usr/local/bin if writable, else ~/.local/bin). # To check the manifest signature yourself, see https://127ohoh1.com/docs#install. set -eu SITE='https://127ohoh1.com' VERSION='2026.09.30-9689cb3' say() { printf '%s\n' "$*"; } die() { printf '127ohoh1 install: %s\n' "$*" >&2; exit 1; } main() { os=$(uname -s) arch=$(uname -m) case "$os" in Linux) os=linux ;; Darwin) os=darwin ;; *) die "no installer for $os; download a build from $SITE/docs#install" ;; esac case "$arch" in x86_64|amd64) arch=amd64 ;; aarch64|arm64) arch=arm64 ;; *) die "no build for CPU $arch" ;; esac case "$os-$arch" in darwin-amd64) name='127ohoh1-darwin-amd64'; want='48e14f84f6a3a18f4a16b67fe25add91a0032e30b914f5006e42a8b4e3702f7c' ;; darwin-arm64) name='127ohoh1-darwin-arm64'; want='e23414d9d5fbd9af65ab9f432e373d40e941017cfcc2ffd94b355d07878aec9b' ;; linux-amd64) name='127ohoh1-linux-amd64'; want='6e0b2e4a0b8aa2285ca82a2b9fc9cf06e25dcddd88afea87502a60b4adf5e6fb' ;; linux-arm64) name='127ohoh1-linux-arm64'; want='777eedb762238d334332c591b5a60b3fad3827a7ed9b29092e6c48c6568b640e' ;; *) die "release $VERSION has no build for $os-$arch" ;; esac dir=${INSTALL_DIR:-} if [ -z "$dir" ]; then if [ -d /usr/local/bin ] && [ -w /usr/local/bin ]; then dir=/usr/local/bin; else dir="$HOME/.local/bin"; fi fi mkdir -p "$dir" tmp=$(mktemp "$dir/.127ohoh1.XXXXXX") trap 'rm -f "$tmp"' EXIT INT TERM url="$SITE/v1/cli/releases/$VERSION/$name" say "Downloading 127ohoh1 $VERSION for $os-$arch from $SITE" if command -v curl >/dev/null 2>&1; then curl -fsSL --proto '=https' --tlsv1.2 -o "$tmp" "$url" || die "download failed: $url" elif command -v wget >/dev/null 2>&1; then wget -q --https-only -O "$tmp" "$url" || die "download failed: $url" else die "curl or wget is required" fi if command -v sha256sum >/dev/null 2>&1; then got=$(sha256sum "$tmp" | cut -d' ' -f1) elif command -v shasum >/dev/null 2>&1; then got=$(shasum -a 256 "$tmp" | cut -d' ' -f1) else die "sha256sum or shasum is required to verify the download" fi [ "$got" = "$want" ] || die "checksum mismatch for $name (want $want, got $got); nothing was installed" chmod 0755 "$tmp" mv -f "$tmp" "$dir/127ohoh1" trap - EXIT INT TERM say "Installed $dir/127ohoh1 ($VERSION)" case ":$PATH:" in *":$dir:"*) ;; *) say "Add $dir to your PATH first, e.g.: export PATH=\"$dir:\$PATH\"" ;; esac say "Next: 127ohoh1 expose http://127.0.0.1:3000" } main "$@"