#!/bin/sh set -e DOMAIN="it.cyou" TUNNEL_PORT="4443" BIN_DIR="/usr/local/bin" BIN="itcyou" OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) case "$ARCH" in x86_64) ARCH="amd64" ;; aarch64|arm64) ARCH="arm64" ;; armv7l) ARCH="arm" ;; *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; esac URL="https://${DOMAIN}/dl/itcyou-${OS}-${ARCH}" TMP=$(mktemp) echo "Downloading itcyou for ${OS}/${ARCH}..." if command -v curl >/dev/null 2>&1; then curl -fL --progress-bar "$URL" -o "$TMP" elif command -v wget >/dev/null 2>&1; then wget --show-progress -qO "$TMP" "$URL" else echo "Error: curl or wget is required." >&2 exit 1 fi chmod +x "$TMP" if [ -w "$BIN_DIR" ]; then mv "$TMP" "$BIN_DIR/$BIN" else sudo mv "$TMP" "$BIN_DIR/$BIN" fi echo "" echo "itcyou installed to $BIN_DIR/$BIN" echo "" echo "Usage:" echo " itcyou 3000 # expose localhost:3000" echo " itcyou 8080 -s myapp # use custom subdomain: myapp.it.cyou" echo " itcyou 3000 -t TOKEN # supply auth token (if server requires)" echo ""