#!/bin/sh # mawam — self-hosted, non-custodial paper-trading grid bot. # Installs a self-contained build (bundled Node + engine) — no Docker, no Node needed. # # curl -fsSL https://mawam.app/install.sh | sh # # Env overrides: MAWAM_VERSION=0.1.0 MAWAM_TARBALL_URL=file:///path/to.tar.gz set -eu REPO="mjatp/mawam-curl-release" OS="$(uname -s | tr '[:upper:]' '[:lower:]')" ARCH="$(uname -m)" case "$ARCH" in aarch64|arm64) ARCH=arm64 ;; x86_64|amd64) ARCH=x64 ;; *) echo "mawam: unsupported CPU arch '$ARCH'"; exit 1 ;; esac case "$OS" in darwin|linux) ;; *) echo "mawam: unsupported OS '$OS' (macOS and Linux only)"; exit 1 ;; esac VERSION="${MAWAM_VERSION:-}" if [ -z "$VERSION" ]; then echo "Finding the latest mawam release…" VERSION="$(curl -fsSL "https://api.github.com/repos/$REPO/releases" \ | grep -o '"tag_name": *"mawam-v[^"]*"' | head -1 | sed 's/.*mawam-v//; s/"$//')" fi [ -n "$VERSION" ] || { echo "mawam: could not determine the latest version (set MAWAM_VERSION=…)"; exit 1; } DIR="mawam-$VERSION-$OS-$ARCH" TARBALL="$DIR.tar.gz" URL="${MAWAM_TARBALL_URL:-https://github.com/$REPO/releases/download/mawam-v$VERSION/$TARBALL}" APP="$HOME/.mawam/app" BIN="$HOME/.local/bin" echo "Installing mawam $VERSION ($OS-$ARCH)…" TMP="$(mktemp -d)" trap 'rm -rf "$TMP"' EXIT if ! curl -fSL "$URL" -o "$TMP/$TARBALL"; then echo "mawam: couldn't download $URL" [ "$OS" = darwin ] && echo " (no self-contained macOS build yet; run mawam with Docker instead: ghcr.io/mjatp/mawam)" exit 1 fi tar xzf "$TMP/$TARBALL" -C "$TMP" mkdir -p "$HOME/.mawam" # app dir is replaced; state/ + logs/ (data) are preserved rm -rf "$APP" mv "$TMP/$DIR" "$APP" mkdir -p "$BIN" # a wrapper (not a symlink) so the launcher resolves its own app dir from $0 cat > "$BIN/mawam" <> ~/.profile && . ~/.profile" ;; esac echo "" echo " Start it: mawam start then open the printed URL (paper trading, free)" echo " Run 24/7: mawam start --lan exposes it on your network (needs the access token)" echo " Manage: mawam status | logs -f | stop"