#!/bin/sh # Starts the InstaKALL radio tool. Nothing is installed: the tool is downloaded to a # temporary folder, checked, run, and removed when you quit. # curl ikall.click | sh set -eu BASE="${IKALL_BASE_URL:-https://ikall.click}" fail() { printf 'ikall: %s\n' "$*" >&2; exit 1; } command -v python3 >/dev/null 2>&1 || fail "python3 is required and was not found." if command -v curl >/dev/null 2>&1; then fetch() { curl -fsSL "$1" -o "$2"; } elif command -v wget >/dev/null 2>&1; then fetch() { wget -q "$1" -O "$2"; } else fail "curl or wget is required."; fi TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT INT TERM fetch "$BASE/ikall" "$TMP/ikall" || fail "could not download $BASE/ikall" fetch "$BASE/ikall.sha256" "$TMP/ikall.sha256" || fail "could not download the checksum" WANT="$(tr -d ' \n\r' < "$TMP/ikall.sha256")" if command -v sha256sum >/dev/null 2>&1; then GOT="$(sha256sum "$TMP/ikall" | cut -d' ' -f1)" elif command -v shasum >/dev/null 2>&1; then GOT="$(shasum -a 256 "$TMP/ikall" | cut -d' ' -f1)" else fail "sha256sum or shasum is required to verify the download."; fi [ "$WANT" = "$GOT" ] || fail "checksum mismatch; not starting." # The script itself arrives on stdin when piped from curl, so the menu reads the terminal. if (: < /dev/tty) 2>/dev/null; then python3 "$TMP/ikall" "$@" < /dev/tty else python3 "$TMP/ikall" "$@"; fi