更新 trojan.sh

This commit is contained in:
2023-11-22 05:38:21 +08:00
parent 6e4e96be35
commit dc2340ffcf

View File

@@ -65,7 +65,7 @@ EOF
sleep 3
rm -rf /usr/share/nginx/html/*
cd /usr/share/nginx/html/
wget https://github.com/xxxbrian/trojan.sh/raw/main/fakesite.zip >/dev/null 2>&1
wget https://gitea.i00.org/gamesme/bash-script/raw/branch/main/fakesite.zip >/dev/null 2>&1
unzip fakesite.zip >/dev/null 2>&1
sleep 5
if [ ! -d "/usr/src" ]; then
@@ -79,7 +79,7 @@ EOF
exit 1
fi
/root/.acme.sh/acme.sh --register-account -m myemail@example.com --server zerossl
/root/.acme.sh/acme.sh --issue -d $your_domain --nginx
/root/.acme.sh/acme.sh --issue -d $your_domain --nginx --ecc
if test -s /root/.acme.sh/$your_domain_ecc/fullchain.cer; then
cert_success="1"
fi
@@ -90,7 +90,7 @@ EOF
minus=$(($now_time - $create_time ))
if [ $minus -gt 5184000 ]; then
/root/.acme.sh/acme.sh --register-account -m myemail@example.com --server zerossl
/root/.acme.sh/acme.sh --issue -d $your_domain --nginx
/root/.acme.sh/acme.sh --issue -d $your_domain --nginx --ecc
if test -s /root/.acme.sh/$your_domain_ecc/fullchain.cer; then
cert_success="1"
fi
@@ -101,7 +101,7 @@ EOF
else
mkdir /usr/src/trojan-cert/$your_domain
/root/.acme.sh/acme.sh --register-account -m myemail@example.com --server zerossl
/root/.acme.sh/acme.sh --issue -d $your_domain --nginx
/root/.acme.sh/acme.sh --issue -d $your_domain --nginx --ecc
if test -s /root/.acme.sh/$your_domain_ecc/fullchain.cer; then
cert_success="1"
fi
@@ -266,7 +266,7 @@ EOF
chmod +x ${systempwd}trojan.service
systemctl enable trojan.service
cd /root
/root/.acme.sh/acme.sh --installcert -d $your_domain \
/root/.acme.sh/acme.sh --installcert --ecc -d $your_domain \
--key-file /usr/src/trojan-cert/$your_domain/private.key \
--fullchain-file /usr/src/trojan-cert/$your_domain/fullchain.cer \
--reloadcmd "systemctl restart trojan"
@@ -279,6 +279,7 @@ EOF
green "==========================================================================="
cat /usr/src/trojan-cli/config.json
green "==========================================================================="
port_forward
else
red "==================================="
red "https证书没有申请成功, 本次安装失败"
@@ -438,8 +439,8 @@ function repair_cert(){
minus=$(($now_time - $create_time ))
if [ $minus -gt 5184000 ]; then
/root/.acme.sh/acme.sh --register-account -m myemail@example.com --server zerossl
/root/.acme.sh/acme.sh --issue -d $your_domain --standalone
/root/.acme.sh/acme.sh --installcert -d $your_domain \
/root/.acme.sh/acme.sh --issue -d $your_domain --standalone --ecc
/root/.acme.sh/acme.sh --installcert --ecc -d $your_domain \
--key-file /usr/src/trojan-cert/$your_domain/private.key \
--fullchain-file /usr/src/trojan-cert/$your_domain/fullchain.cer \
--reloadcmd "systemctl restart trojan"
@@ -451,7 +452,7 @@ function repair_cert(){
red "申请证书失败"
fi
else
~/.acme.sh/acme.sh --installcert -d $your_domain \
/root/.acme.sh/acme.sh --installcert --ecc -d $your_domain \
--key-file /usr/src/trojan-cert/$your_domain/private.key \
--fullchain-file /usr/src/trojan-cert/$your_domain/fullchain.cer \
--reloadcmd "systemctl restart trojan"