From bc7e4fe36b3d9826caf6f17ef4e212736cecdc0b Mon Sep 17 00:00:00 2001 From: qaq <1937228092@qq.com> Date: Thu, 12 Jun 2025 16:43:37 +0800 Subject: [PATCH] 1 --- install.sh | 186 ++++++++++++++++++++++++++--------------------------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/install.sh b/install.sh index 1f4b698..0513582 100644 --- a/install.sh +++ b/install.sh @@ -1,93 +1,93 @@ -#!/bin/bash - -ARCH=$(uname -m) -if [[ "$ARCH" != "x86_64" ]]; then - echo "❌ 不支持的架构: $ARCH,仅支持 x86_64。" - exit 1 -fi - -# 固定gost下载地址 -DOWNLOAD_URL="https://raw.githubusercontent.com/bqlpfy/forward-panel/refs/heads/main/gost" - -while getopts "a:p:s:" opt; do - case $opt in - a) SERVER_ADDR="$OPTARG" ;; - p) PORT="$OPTARG" ;; - s) SECRET="$OPTARG" ;; - *) echo "无效参数"; exit 1 ;; - esac -done - -if [[ -z "$SERVER_ADDR" || -z "$PORT" || -z "$SECRET" ]]; then - echo "用法: $0 -a 服务器地址 -p 端口 -s 密钥" - exit 1 -fi - - -INSTALL_DIR="/etc/gost" -mkdir -p "$INSTALL_DIR" - - -for FILE in gost config.json gost.json; do - if [[ -f "$INSTALL_DIR/$FILE" ]]; then - echo "删除已有文件: $INSTALL_DIR/$FILE" - rm -f "$INSTALL_DIR/$FILE" - fi -done - - -# 下载gost可执行文件 -curl -L "$DOWNLOAD_URL" -o "$INSTALL_DIR/gost" -chmod +x "$INSTALL_DIR/gost" - - -cat > "$INSTALL_DIR/config.json" < "$INSTALL_DIR/gost.json" < /etc/systemd/system/gost.service < "$INSTALL_DIR/config.json" < "$INSTALL_DIR/gost.json" < /etc/systemd/system/gost.service <