#!/usr/bin/env bash # MOBero installer — curl -fsSL https://mobero.org/install.sh | sh # # Downloads the extension + native host, installs xmrig, and registers the host # with your browser. It does not start mining, and it never asks for a wallet: # you paste that into the extension yourself. set -euo pipefail ORIGIN="${MOBERO_ORIGIN:-https://mobero.org}" DEST="$HOME/.mobero/app" HOST_ID="com.mobero.host" EXT_ID="bgnkdiknnhpffnhhehnbodmnjcgbjoap" say() { printf '\033[38;5;208m»\033[0m %s\n' "$1"; } warn() { printf '\033[33m!\033[0m %s\n' "$1"; } die() { printf '\033[31m✗ %s\033[0m\n' "$1" >&2; exit 1; } [ "$(uname -s)" = "Darwin" ] || die "macOS only for now — Linux support is not written yet" # ------------------------------------------------------------------ prereqs command -v node >/dev/null 2>&1 || die "node not found — install Node.js first (brew install node)" command -v curl >/dev/null 2>&1 || die "curl not found" if ! command -v xmrig >/dev/null 2>&1 && [ ! -x /opt/homebrew/bin/xmrig ] && [ ! -x /usr/local/bin/xmrig ]; then command -v brew >/dev/null 2>&1 || die "xmrig not found and homebrew is unavailable — install xmrig manually" say "installing xmrig…" brew install xmrig fi XMRIG="$(command -v xmrig || echo /usr/local/bin/xmrig)" say "xmrig: $XMRIG" if [ "$(uname -m)" = "arm64" ] && /usr/bin/file -b "$XMRIG" | grep -q x86_64; then warn "that xmrig is an Intel build — it will run under Rosetta and mine far slower than native" fi # ------------------------------------------------------------------ download TMP="$(mktemp -d)" trap 'rm -rf "$TMP"' EXIT say "downloading MOBero…" curl -fsSL "$ORIGIN/mobero.tar.gz" -o "$TMP/mobero.tar.gz" if curl -fsSL "$ORIGIN/mobero.tar.gz.sha256" -o "$TMP/expected" 2>/dev/null; then actual="$(shasum -a 256 "$TMP/mobero.tar.gz" | cut -d' ' -f1)" expected="$(tr -d '[:space:]' < "$TMP/expected")" [ "$actual" = "$expected" ] || die "checksum mismatch — refusing to install (got $actual)" say "checksum verified" else warn "no checksum published; continuing unverified" fi rm -rf "$DEST" mkdir -p "$DEST" tar -xzf "$TMP/mobero.tar.gz" -C "$DEST" say "installed to $DEST" HOST_JS="$DEST/host/mobero-host.js" [ -f "$HOST_JS" ] || die "archive is missing host/mobero-host.js" # The browser launches the host with a minimal PATH, so pin the interpreter. NODE="$(command -v node)" tmp="$(mktemp)" { printf '#!%s\n' "$NODE"; tail -n +2 "$HOST_JS"; } > "$tmp" mv "$tmp" "$HOST_JS" chmod +x "$HOST_JS" # ------------------------------------------------------- register the host MANIFEST=$(cat < "$dir/$HOST_ID.json" say "registered for $(basename "$(dirname "$dir")")" installed=$((installed + 1)) done [ "$installed" -gt 0 ] || die "no supported Chromium browser found" cat <