#!/usr/bin/env bash set -euo pipefail # ========================================================== # BLACKBELT PTERODACTYL INSTALLER # Remote: https://cmd.strengthcloud.xyz # ========================================================== RED='\033[1;31m' GREEN='\033[1;32m' YELLOW='\033[1;33m' CYAN='\033[1;36m' MAGENTA='\033[1;35m' WHITE='\033[1;37m' GRAY='\033[0;37m' RESET='\033[0m' VERSION="1.0.0" WINGS_VERSION="v1.13.2" pause() { echo read -rp "Press Enter to continue..." } banner() { clear echo -e "${MAGENTA}" cat <<'EOF' ██████╗ ██╗ █████╗ ██████╗██╗ ██╗██████╗ ███████╗██╗ ████████╗ ██╔══██╗██║ ██╔══██╗██╔════╝██║ ██╔╝██╔══██╗██╔════╝██║ ╚══██╔══╝ ██████╔╝██║ ███████║██║ ██████╔╝ ██████╔╝█████╗ ██║ ██║ ██╔══██╗██║ ██╔══██║██║ ██╔═██╗ ██╔══██╗██╔══╝ ██║ ██║ ██████╔╝███████╗██║ ██║╚██████╗██║ ██╗ ██████╔╝███████╗███████╗██║ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝╚═╝ EOF echo -e "${RESET}" echo -e "${CYAN}╔══════════════════════════════════════════════════════════════╗${RESET}" echo -e "${CYAN}║${RESET} ${WHITE}BLACKBELT INSTALLER${RESET} ${CYAN}║${RESET}" echo -e "${CYAN}║${RESET} ${GRAY}Pterodactyl Panel & Wings${RESET} ${CYAN}║${RESET}" echo -e "${CYAN}║${RESET} ${GRAY}v${VERSION}${RESET} ${CYAN}║${RESET}" echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${RESET}" echo } root_check() { if [[ "$EUID" -ne 0 ]]; then echo -e "${RED}[✗] Please run this command as root.${RESET}" exit 1 fi echo -e "${GREEN}[✓] Root access detected${RESET}" } os_check() { if [[ ! -f /etc/os-release ]]; then echo -e "${RED}[✗] Cannot detect operating system.${RESET}" exit 1 fi source /etc/os-release if [[ "$ID" != "ubuntu" ]]; then echo -e "${RED}[✗] Only Ubuntu is supported.${RESET}" exit 1 fi echo -e "${GREEN}[✓] Ubuntu ${VERSION_ID} detected${RESET}" } install_basic() { echo echo -e "${YELLOW}[+] Installing basic dependencies...${RESET}" apt-get update apt-get install -y \ curl \ wget \ ca-certificates \ gnupg \ git \ unzip \ tar \ nginx echo -e "${GREEN}[✓] Basic dependencies installed${RESET}" } install_docker() { echo echo -e "${YELLOW}[+] Checking Docker...${RESET}" if command -v docker >/dev/null 2>&1; then echo -e "${GREEN}[✓] Docker already installed${RESET}" systemctl enable --now docker 2>/dev/null || true return fi echo -e "${CYAN}[+] Installing Docker...${RESET}" curl -fsSL https://get.docker.com | sh systemctl enable --now docker echo -e "${GREEN}[✓] Docker installed${RESET}" } install_wings() { echo echo -e "${MAGENTA}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}" echo -e "${WHITE} WINGS INSTALLATION${RESET}" echo -e "${MAGENTA}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}" install_docker mkdir -p /etc/pterodactyl ARCH="$(uname -m)" case "$ARCH" in x86_64) WINGS_ARCH="amd64" ;; aarch64) WINGS_ARCH="arm64" ;; *) echo -e "${RED}[✗] Unsupported architecture: $ARCH${RESET}" return 1 ;; esac WINGS_URL="https://github.com/pterodactyl/wings/releases/download/${WINGS_VERSION}/wings_linux_${WINGS_ARCH}" echo echo -e "${CYAN}[+] Downloading Wings ${WINGS_VERSION}...${RESET}" TMP_WINGS="$(mktemp)" if ! curl -fL --retry 3 -o "$TMP_WINGS" "$WINGS_URL"; then echo -e "${RED}[✗] Wings download failed.${RESET}" rm -f "$TMP_WINGS" return 1 fi if [[ ! -s "$TMP_WINGS" ]]; then echo -e "${RED}[✗] Downloaded Wings file is empty.${RESET}" rm -f "$TMP_WINGS" return 1 fi chmod +x "$TMP_WINGS" echo -e "${CYAN}[+] Stopping existing Wings service...${RESET}" systemctl stop wings 2>/dev/null || true mv "$TMP_WINGS" /usr/local/bin/wings chmod 755 /usr/local/bin/wings echo -e "${GREEN}[✓] Wings binary installed${RESET}" echo /usr/local/bin/wings version || true echo echo -e "${YELLOW}[!] Wings configuration is still required.${RESET}" echo -e "${GRAY} The Panel node generates config.yml for Wings.${RESET}" } install_panel() { echo echo -e "${MAGENTA}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}" echo -e "${WHITE} PANEL INSTALLATION${RESET}" echo -e "${MAGENTA}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}" echo echo -e "${YELLOW}[!] Panel installer module is not enabled yet.${RESET}" echo echo -e "${GRAY}The next BlackBelt release will configure:${RESET}" echo -e " ${CYAN}•${RESET} PHP" echo -e " ${CYAN}•${RESET} MariaDB" echo -e " ${CYAN}•${RESET} Redis" echo -e " ${CYAN}•${RESET} Composer" echo -e " ${CYAN}•${RESET} Pterodactyl Panel" echo -e " ${CYAN}•${RESET} Nginx" } full_install() { echo echo -e "${MAGENTA}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}" echo -e "${WHITE} BLACKBELT FULL INSTALLATION${RESET}" echo -e "${MAGENTA}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}" install_basic install_panel install_wings echo echo -e "${GREEN}╔════════════════════════════════════════╗${RESET}" echo -e "${GREEN}║ BLACKBELT INSTALL COMPLETE ║${RESET}" echo -e "${GREEN}╚════════════════════════════════════════╝${RESET}" } menu() { while true; do banner echo -e "${WHITE}1)${RESET} Install Pterodactyl Panel" echo -e "${WHITE}2)${RESET} Install Wings" echo -e "${WHITE}3)${RESET} Install Panel + Wings" echo -e "${WHITE}4)${RESET} Exit" echo read -rp "Select an option: " choice case "$choice" in 1) root_check os_check install_basic install_panel pause ;; 2) root_check os_check install_wings pause ;; 3) root_check os_check full_install pause ;; 4) clear exit 0 ;; *) echo -e "${RED}[✗] Invalid option.${RESET}" sleep 1 ;; esac done } menu