#!/usr/bin/env bash set -e # ========================= # Detect OS + ARCH # ========================= OS="$(uname -s | tr '[:upper:]' '[:lower:]')" ARCH="$(uname -m)" case "$ARCH" in x86_64|amd64) ARCH="amd64" ;; arm64|aarch64) ARCH="arm64" ;; *) echo "unsupported architecture: $ARCH" exit 1 ;; esac if [[ "$OS" != "linux" && "$OS" != "darwin" ]]; then echo "unsupported OS: $OS" exit 1 fi echo "" echo "Download started. Please be patient while we install the sensor. Detected OS: $OS, ARCH: $ARCH" echo "" # ========================= # Config (from Go injection) # ========================= BASE_URL="https://shuffler.io" QUEUE="default" AUTH="cb5st3d3Z!3X3zaJ*Pc" ORG_ID="" SOFTWARE_LIST_ENABLED="true" CODE_SCANNER_ENABLED="false" HD_ENCRYPTED_CHECK="true" SCREENLOCK_CHECK="true" RESPONSE_ACTIONS="full" LOG_FORWARDING="" # ========================= # Binary selection # ========================= BIN_BASE="https://github.com/Shuffle/orborus/releases/latest/download" BIN_URL="${BIN_BASE}/orborus-agent-${OS}-${ARCH}" # ========================= # Install binary # ========================= INSTALL_PATH="/usr/local/bin/orborus" echo "Please input your sudo password to allow installation (required for service setup and sensor capabilities). Contact support@shuffler.io if you need help." curl -fsSL "$BIN_URL" -o /tmp/orborus chmod +x /tmp/orborus sudo mv /tmp/orborus "$INSTALL_PATH" echo "Installed binary to $INSTALL_PATH" # ========================= # Linux service (systemd) # ========================= install_linux() { sudo tee /etc/systemd/system/orborus.service > /dev/null < "$PLIST" < Label com.orborus.agent ProgramArguments $INSTALL_PATH --sensor_mode=true --base_url=$BASE_URL --queue=$QUEUE --auth=$AUTH --org_id=$ORG_ID --software_list_enabled=$SOFTWARE_LIST_ENABLED --code_scanner_enabled=$CODE_SCANNER_ENABLED --hd_encrypted_check=$HD_ENCRYPTED_CHECK --screenlock_check=$SCREENLOCK_CHECK --log_forwarding=$LOG_FORWARDING --response_actions=$RESPONSE_ACTIONS RunAtLoad EOF launchctl unload "$PLIST" 2>/dev/null || true launchctl load "$PLIST" } # ========================= # Execute # ========================= if [[ "$OS" == "linux" ]]; then install_linux elif [[ "$OS" == "darwin" ]]; then install_macos fi echo "orborus installed successfully"