#!/bin/sh # curl -fsSL marcusx.fun | sh # Makes this computer a full member: its own VPS, a door to every other machine, # and the master MCP hub. It dials OUT. Nothing listens. Nothing is opened. set -e G='\033[92m'; C='\033[96m'; D='\033[2m'; B='\033[1m'; X='\033[0m' printf "\n${B} joining the mesh${X}\n\n" P="" for c in python3 python py; do command -v "$c" >/dev/null 2>&1 && { P="$c"; break; }; done if [ -z "$P" ]; then printf " installing python...\n" if command -v brew >/dev/null 2>&1; then brew install python >/dev/null 2>&1 elif command -v apt-get >/dev/null 2>&1; then sudo apt-get update -qq && sudo apt-get install -y -qq python3 elif command -v dnf >/dev/null 2>&1; then sudo dnf install -y -q python3 elif command -v pacman >/dev/null 2>&1; then sudo pacman -S --needed --noconfirm python elif command -v apk >/dev/null 2>&1; then sudo apk add python3; fi for c in python3 python py; do command -v "$c" >/dev/null 2>&1 && { P="$c"; break; }; done fi [ -z "$P" ] && { echo " need python — install it, then run this again"; exit 1; } mkdir -p "$HOME/.mesh" "$HOME/bin" # 1. the door: this machine dials out and holds the line curl -fsSL https://tower.marcusx.fun/agent.py -o "$HOME/.mesh/agent.py" CR_WHO="$(hostname 2>/dev/null || echo machine)"; export CR_WHO pkill -f '.mesh/agent.py' 2>/dev/null || true nohup "$P" "$HOME/.mesh/agent.py" >"$HOME/.mesh/agent.log" 2>&1 & printf " ${G}✓${X} door open ${D}%s dials out · nothing listens${X}\n" "$CR_WHO" # 2. keep it open across reboots if [ "$(uname)" = "Darwin" ]; then mkdir -p "$HOME/Library/LaunchAgents" cat > "$HOME/Library/LaunchAgents/fun.marcusx.mesh.plist" < Labelfun.marcusx.mesh ProgramArguments$P$HOME/.mesh/agent.py EnvironmentVariablesCR_WHO$CR_WHO RunAtLoadKeepAlive PL launchctl unload "$HOME/Library/LaunchAgents/fun.marcusx.mesh.plist" 2>/dev/null || true launchctl load "$HOME/Library/LaunchAgents/fun.marcusx.mesh.plist" 2>/dev/null || true elif command -v systemctl >/dev/null 2>&1; then mkdir -p "$HOME/.config/systemd/user" cat > "$HOME/.config/systemd/user/mesh.service" </dev/null || true systemctl --user enable --now mesh.service 2>/dev/null || true fi printf " ${G}✓${X} survives reboot\n" # 3. the pearl command: every machine + the master MCP hub, from this shell curl -fsSL https://marcusx.fun/pearl -o "$HOME/bin/pearl" && chmod +x "$HOME/bin/pearl" printf " ${G}✓${X} pearl installed ${D}· %s/bin/pearl${X}\n" "$HOME" curl -fsSL https://marcusx.fun/gesherel -o "$HOME/bin/gesherel" && chmod +x "$HOME/bin/gesherel" printf " ${G}✓${X} gesherel ready ${D}· type: gesherel${X}\n" case ":$PATH:" in *":$HOME/bin:"*) :;; *) for rc in "$HOME/.bashrc" "$HOME/.zshrc"; do [ -f "$rc" ] && ! grep -q 'mesh:PATH' "$rc" && printf '\nexport PATH="$HOME/bin:$PATH" # mesh:PATH\n' >> "$rc" done;; esac printf "\n${B} you are on the mesh.${X}\n" printf " ${C}pearl${X} ${D}every machine, every MCP, every tool${X}\n" printf " ${C}pearl ${X} ${D}raw shell on any of them${X}\n" printf " ${D}leave: pkill -f .mesh/agent.py${X}\n\n"