From 00d592ae70ef5212f9e690457c44213954e72e62 Mon Sep 17 00:00:00 2001 From: Randall Date: Tue, 31 Dec 2024 03:57:26 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20vpn/setup=5Fserver=5Fssl.s?= =?UTF-8?q?h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vpn/setup_server_ssl.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/vpn/setup_server_ssl.sh b/vpn/setup_server_ssl.sh index cc865ac..71438c6 100644 --- a/vpn/setup_server_ssl.sh +++ b/vpn/setup_server_ssl.sh @@ -1,7 +1,7 @@ #!/bin/bash # 检查是否提供了必要的参数 -if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then +if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ]; then echo "Usage: $0 " exit 1 fi @@ -10,15 +10,16 @@ fi DONAMEFRONT="$1" CF_Key="$2" CF_Email="$3" +DONAMEEND="$4" # 更新系统并安装必要的软件包 sudo apt update && sudo apt upgrade -y && sudo apt install vim wget curl net-tools socat -y # 设置主机名 -sudo hostnamectl set-hostname "$DONAMEFRONT.randallanjie-proxy.win" +sudo hostnamectl set-hostname "$DONAMEFRONT.$DONAMEEND" # 运行acme脚本安装acme -curl https://get.acme.sh | sh -s email="$DONAMEFRONT@randallanjie-proxy.win" +curl https://get.acme.sh | sh -s email="$DONAMEFRONT@$DONAMEEND" # 添加或更新环境变量到.acme.sh/acme.sh.env文件 ENV_FILE="$HOME/.acme.sh/acme.sh.env" @@ -32,6 +33,11 @@ export CF_Email="$CF_Email" # 设置acme并申请证书 ~/.acme.sh/acme.sh --upgrade --auto-upgrade ~/.acme.sh/acme.sh --set-default-ca --server letsencrypt -~/.acme.sh/acme.sh --issue -d "$DONAMEFRONT.randallanjie-proxy.win" -d "$DONAMEFRONT-cdn.randallanjie-proxy.win" -d "$DONAMEFRONT-proxy.randallanjie-proxy.win" --dns dns_cf --dnssleep +~/.acme.sh/acme.sh --issue -d "$DONAMEFRONT.$DONAMEEND" -d "$DONAMEFRONT-cdn.$DONAMEEND" -d "$DONAMEFRONT-proxy.$DONAMEEND" --dns dns_cf --dnssleep + +~/.acme.sh/acme.sh --installcert -d $(hostname) --key-file /etc/V2bX/cert.key --fullchain-file /etc/V2bX/fullchain.cer --reloadcmd "v2bx restart" + +echo "Setup complete for $DONAMEFRONT.$DONAMEEND" + +wget -N https://raw.githubusercontent.com/wyx2685/V2bX-script/master/install.sh && bash install.sh -echo "Setup complete for $DONAMEFRONT.randallanjie-proxy.win and $DONAMEFRONT-cdn.randallanjie-proxy.win" \ No newline at end of file