#!/usr/bin/env bash # mrmpanel bootstrap installer — single-file entrypoint # Downloads the full package from the release mirror, then runs the real installer. # # Usage: # curl -fsSL https://mrmpanel.hostingandstuff.online/install.sh | sudo bash # curl -fsSL https://mrmpanel.hostingandstuff.online/install.sh | sudo bash -s -- --all # sudo bash install.sh --web --mariadb # set -euo pipefail MRMPANEL_MIRROR="${MRMPANEL_MIRROR:-https://mrmpanel.hostingandstuff.online}" MRMPANEL_VERSION="${MRMPANEL_VERSION:-latest}" WORKDIR="${TMPDIR:-/tmp}/mrmpanel-bootstrap-$$" RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' log() { echo -e "${GREEN}[mrmpanel]${NC} $*"; } warn() { echo -e "${YELLOW}[mrmpanel]${NC} $*"; } err() { echo -e "${RED}[mrmpanel]${NC} $*" >&2; } die() { err "$*"; exit 1; } cleanup() { rm -rf "$WORKDIR" 2>/dev/null || true; } trap cleanup EXIT [[ $(id -u) -eq 0 ]] || die "Run as root: curl -fsSL ${MRMPANEL_MIRROR}/install.sh | sudo bash -s -- --all" # Need curl or wget if command -v curl >/dev/null 2>&1; then fetch() { curl -fsSL --connect-timeout 30 --retry 3 -o "$2" "$1"; } elif command -v wget >/dev/null 2>&1; then fetch() { wget -q -O "$2" "$1"; } else die "Need curl or wget to download the package" fi TARBALL_URL="${MRMPANEL_MIRROR}/releases/mrmpanel-${MRMPANEL_VERSION}.tar.gz" CHECKSUM_URL="${MRMPANEL_MIRROR}/releases/mrmpanel-${MRMPANEL_VERSION}.sha256" mkdir -p "$WORKDIR" cd "$WORKDIR" log "Downloading package from ${TARBALL_URL}" fetch "$TARBALL_URL" mrmpanel.tar.gz || die "Download failed. Is DNS for mrmpanel.hostingandstuff.online pointing here?" if fetch "$CHECKSUM_URL" mrmpanel.sha256 2>/dev/null; then log "Verifying checksum…" if command -v sha256sum >/dev/null 2>&1; then echo "$(awk '{print $1}' mrmpanel.sha256) mrmpanel.tar.gz" | sha256sum -c - \ || die "Checksum mismatch — aborting" fi else warn "No checksum file found; continuing without verification" fi log "Extracting…" tar -xzf mrmpanel.tar.gz SRC="$(find "$WORKDIR" -maxdepth 1 -type d -name 'mrmpanel-*' | head -1)" [[ -n "$SRC" && -f "$SRC/scripts/install-full.sh" ]] || die "Package layout unexpected (missing scripts/install-full.sh)" log "Starting full installer…" # Pass through all CLI args to the real installer exec bash "$SRC/scripts/install-full.sh" "$@"