#!/bin/bash # ============================================================ # SKY CLOUD Installer # Usage: bash <(curl -s https://YOUR-DOMAIN/skycloud.sh) # ============================================================ set -u # ---------- Cyan gradient helpers (truecolor) ---------- # Prints a line with a horizontal gradient from light cyan to deep cyan/blue gradient_line() { local text="$1" local len=${#text} local r1=0 g1=255 b1=255 # start: bright cyan local r2=0 g2=110 b2=200 # end: deep sky blue local out="" i r g b ch for ((i = 0; i < len; i++)); do ch="${text:$i:1}" if [ "$len" -gt 1 ]; then r=$(( r1 + (r2 - r1) * i / (len - 1) )) g=$(( g1 + (g2 - g1) * i / (len - 1) )) b=$(( b1 + (b2 - b1) * i / (len - 1) )) else r=$r1; g=$g1; b=$b1 fi out+="\e[38;2;${r};${g};${b}m${ch}" done printf "%b\e[0m\n" "$out" } CYAN="\e[38;2;0;220;255m" DIM="\e[38;2;120;200;220m" RED="\e[38;2;255;90;90m" GREEN="\e[38;2;80;255;160m" RESET="\e[0m" banner() { clear echo gradient_line " ███████╗██╗ ██╗██╗ ██╗ ██████╗██╗ ██████╗ ██╗ ██╗██████╗ " gradient_line " ██╔════╝██║ ██╔╝╚██╗ ██╔╝ ██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗" gradient_line " ███████╗█████╔╝ ╚████╔╝ ██║ ██║ ██║ ██║██║ ██║██║ ██║" gradient_line " ╚════██║██╔═██╗ ╚██╔╝ ██║ ██║ ██║ ██║██║ ██║██║ ██║" gradient_line " ███████║██║ ██╗ ██║ ╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝" gradient_line " ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ " echo gradient_line " ──────────────────── S K Y C L O U D I N S T A L L E R ────────────────────" echo } info() { echo -e "${CYAN}[SKY CLOUD]${RESET} $*"; } ok() { echo -e "${GREEN}[ OK ]${RESET} $*"; } fail() { echo -e "${RED}[FAIL]${RESET} $*"; } # ---------- Pre-flight checks ---------- preflight() { if [ "$(id -u)" -ne 0 ]; then fail "Please run as root (sudo -i, then run the command again)." exit 1 fi if ! command -v curl >/dev/null 2>&1; then info "Installing curl..." (apt-get update -y && apt-get install -y curl) >/dev/null 2>&1 \ || yum install -y curl >/dev/null 2>&1 \ || { fail "Could not install curl."; exit 1; } fi if [ -r /etc/os-release ]; then . /etc/os-release info "Detected OS: ${PRETTY_NAME:-unknown}" fi } # ---------- Actions ---------- # Wraps the open-source pterodactyl-installer (https://github.com/pterodactyl-installer) run_upstream() { info "Launching installer..." echo bash <(curl -fsSL https://pterodactyl-installer.se) } pause() { echo; read -rp "$(echo -e "${DIM}Press Enter to return to menu...${RESET}")" _; } menu() { while true; do banner echo -e " ${CYAN}[1]${RESET} Install Panel / Wings ${DIM}(Pterodactyl installer)${RESET}" echo -e " ${CYAN}[2]${RESET} System info" echo -e " ${CYAN}[3]${RESET} Update system packages" echo -e " ${CYAN}[0]${RESET} Exit" echo read -rp "$(echo -e "${CYAN}SKY CLOUD ❯ ${RESET}")" choice case "$choice" in 1) run_upstream; pause ;; 2) echo info "Hostname : $(hostname)" info "Kernel : $(uname -r)" info "CPU : $(nproc) core(s)" info "RAM : $(free -h | awk '/Mem:/ {print $2}')" info "Disk : $(df -h / | awk 'NR==2 {print $4 " free of " $2}')" pause ;; 3) info "Updating packages..." (apt-get update -y && apt-get upgrade -y) || yum update -y ok "Done." pause ;; 0) echo -e "\n${CYAN}Thanks for using SKY CLOUD!${RESET}\n"; exit 0 ;; *) fail "Invalid option."; sleep 1 ;; esac done } preflight menu