2026-04-27 21:56:29 +08:00
|
|
|
|
#!/usr/bin/env bash
|
2026-04-27 22:05:13 +08:00
|
|
|
|
# 顶尖协议一键脚本统一入口: ss2022+shadowtls / anytls / snell v5 / Reality
|
|
|
|
|
|
set -e
|
2026-04-27 21:57:22 +08:00
|
|
|
|
BASE_URL="${MIRROR_BASE_URL:-https://mjjtop.com/admin/proxy-installer/raw/branch/main}"
|
2026-04-27 21:56:29 +08:00
|
|
|
|
TMP_DIR="/tmp/mjjtop-proxy-installer"
|
|
|
|
|
|
mkdir -p "$TMP_DIR"
|
2026-04-27 22:05:13 +08:00
|
|
|
|
err(){ echo "[ERROR] $*" >&2; exit 1; }
|
|
|
|
|
|
info(){ echo "[INFO] $*"; }
|
|
|
|
|
|
[ "${PROXY_INSTALLER_SKIP_ROOT_CHECK:-0}" = "1" ] || [ "$(id -u)" = "0" ] || err "请用 root 运行"
|
|
|
|
|
|
command -v curl >/dev/null 2>&1 || err "缺少 curl,请先安装: apt install -y curl"
|
|
|
|
|
|
run_remote(){
|
|
|
|
|
|
name="$1"
|
|
|
|
|
|
script_path="$2"
|
|
|
|
|
|
file="$TMP_DIR/$script_path"
|
|
|
|
|
|
info "下载 $name: $BASE_URL/scripts/$script_path"
|
2026-04-27 22:03:21 +08:00
|
|
|
|
curl -fsSL "$BASE_URL/scripts/$script_path" -o "$file"
|
2026-04-27 21:56:29 +08:00
|
|
|
|
chmod +x "$file"
|
|
|
|
|
|
info "开始执行 $name"
|
|
|
|
|
|
exec bash "$file"
|
|
|
|
|
|
}
|
|
|
|
|
|
case "${1:-}" in
|
|
|
|
|
|
ss|ss2022|shadowtls) run_remote "ss2022 + shadowtls" "ss2022-shadowtls.sh" ;;
|
2026-04-27 22:05:13 +08:00
|
|
|
|
anytls|any) run_remote "anytls" "anytls.sh" ;;
|
|
|
|
|
|
snell|snell5) run_remote "snell v5" "snell-v5.sh" ;;
|
|
|
|
|
|
reality|xray) run_remote "Reality (Xray)" "reality.sh" ;;
|
2026-04-27 21:56:29 +08:00
|
|
|
|
"") ;;
|
2026-04-27 22:05:13 +08:00
|
|
|
|
*) err "未知参数: $1,可用: ss | anytls | snell | reality" ;;
|
|
|
|
|
|
esac
|
|
|
|
|
|
cat <<'MENU'
|
|
|
|
|
|
========================================
|
|
|
|
|
|
顶尖协议一键脚本 / mjjtop proxy
|
|
|
|
|
|
========================================
|
|
|
|
|
|
1) ss2022 + shadowtls
|
|
|
|
|
|
2) anytls
|
|
|
|
|
|
3) snell v5
|
|
|
|
|
|
4) Reality (Xray)
|
|
|
|
|
|
0) 退出
|
|
|
|
|
|
MENU
|
|
|
|
|
|
printf '请选择协议 [0-4]: '
|
|
|
|
|
|
read choice
|
|
|
|
|
|
case "$choice" in
|
|
|
|
|
|
1) run_remote "ss2022 + shadowtls" "ss2022-shadowtls.sh" ;;
|
|
|
|
|
|
2) run_remote "anytls" "anytls.sh" ;;
|
|
|
|
|
|
3) run_remote "snell v5" "snell-v5.sh" ;;
|
|
|
|
|
|
4) run_remote "Reality (Xray)" "reality.sh" ;;
|
|
|
|
|
|
0|q|Q) exit 0 ;;
|
|
|
|
|
|
*) err "无效选择" ;;
|
2026-04-27 21:56:29 +08:00
|
|
|
|
esac
|