#!/bin/bash # ========================================== # 1011 Advanced Hysteria2 Installer # ========================================== # အရောင်များ သတ်မှတ်ခြင်း GREEN="\e[32m" CYAN="\e[36m" YELLOW="\e[33m" RESET="\e[0m" # Logo ပြသခြင်း echo -e "${GREEN}" cat << "EOF" __ __ __ __ /_ |/ _ \/_ |/_ | | | | | || | | | | | | | || | | | | | |_| || | | | |_|\___/ |_| |_| EOF echo -e "${RESET}" echo -e "${CYAN}=> Starting 1011 Advanced Setup...${RESET}\n" # (၁) Hysteria2 ကို Install/Update လုပ်ခြင်း echo -e "${YELLOW}=> Installing/Updating Hysteria2...${RESET}" bash <(curl -fsSL https://get.hy2.sh/) # (၂) Folder များ တည်ဆောက်ခြင်း mkdir -p /etc/hysteria # (၃) Auto SSL Certificate ဖန်တီးခြင်း echo -e "${YELLOW}=> Generating SSL Certificates...${RESET}" openssl ecparam -genkey -name prime256v1 -out /etc/hysteria/server.key openssl req -new -x509 -days 36500 -key /etc/hysteria/server.key -out /etc/hysteria/server.crt -subj "/CN=bing.com" >/dev/null 2>&1 # (၄) pinSHA256 တွက်ချက်ခြင်း PIN=$(openssl x509 -noout -fingerprint -sha256 -in /etc/hysteria/server.crt | tr -d ':' | cut -d'=' -f2 | tr '[:upper:]' '[:lower:]') # (၅) Server IP ကို အလိုအလျောက် ရှာဖွေခြင်း IP=$(curl -s -4 ipv4.icanhazip.com) PORT=443 PASSWORD="1011_password" # (၆) Config ဖိုင် ရေးသားခြင်း echo -e "${YELLOW}=> Writing configuration...${RESET}" cat << EOF_CONFIG > /etc/hysteria/config.yaml listen: :${PORT} tls: cert: /etc/hysteria/server.crt key: /etc/hysteria/server.key auth: type: password password: "${PASSWORD}" masquerade: type: proxy proxy: url: https://bing.com rewriteHost: true EOF_CONFIG # (၇) Service ကို စတင်ခြင်း (Auto Start) systemctl enable hysteria-server.service >/dev/null 2>&1 systemctl restart hysteria-server.service # (၈) V2rayN/Nekobox Link တည်ဆောက်ခြင်း LINK="hysteria2://${PASSWORD}@${IP}:${PORT}/?security=tls&insecure=0&pinSHA256=${PIN}&sni=www.bing.com#1011_Hysteria2" # (၉) ရလဒ်များကို လှပစွာ ပြသခြင်း echo -e "\n${CYAN}============================================${RESET}" echo -e "${GREEN}1011 Hysteria2 Setup Completed Successfully!${RESET}" echo -e "${CYAN}============================================${RESET}" echo -e "Local IP: ${YELLOW}${IP}${RESET}" echo -e "Port: ${YELLOW}${PORT}${RESET}" echo -e "Password: ${YELLOW}${PASSWORD}${RESET}" echo -e "pinSHA256: ${YELLOW}${PIN}${RESET}" echo -e "Cert Path: ${YELLOW}/etc/hysteria/server.crt${RESET}" echo -e "Key Path: ${YELLOW}/etc/hysteria/server.key${RESET}" echo -e "${CYAN}============================================${RESET}" echo -e "${GREEN}V2rayN or Nekobox Link:${RESET}" echo -e "${CYAN}============================================${RESET}" echo -e "${YELLOW}${LINK}${RESET}\n"