@@ -201,7 +201,7 @@ preinstall() {
201
201
# get dependencies
202
202
${sudoCmd} ${PACKAGE_MANAGEMENT_INSTALL} epel-release -y 2> /dev/null # centos
203
203
${sudoCmd} ${PACKAGE_MANAGEMENT_UPDATE} -y
204
- ${sudoCmd} ${PACKAGE_MANAGEMENT_INSTALL} coreutils curl git wget unzip xz-utils -y
204
+ ${sudoCmd} ${PACKAGE_MANAGEMENT_INSTALL} coreutils curl git socat wget unzip xz-utils -y
205
205
206
206
${sudoCmd} ${PACKAGE_MANAGEMENT_INSTALL} jq -y
207
207
# install jq mannualy if the package management didn't
@@ -228,6 +228,21 @@ get_cert() {
228
228
--reloadcmd " chmod 644 /etc/ssl/v2ray/fullchain.pem; chmod 644 /etc/ssl/v2ray/key.pem; systemctl restart v2ray"
229
229
}
230
230
231
+ get_cert_alt () {
232
+ # use standalone mode to issue cert
233
+ ${sudoCmd} stop caddy 2> /dev/null
234
+ colorEcho ${BLUE} " Issuing certificate"
235
+ ${sudoCmd} /root/.acme.sh/acme.sh --issue -d " $1 " --standalone --keylength ec-256
236
+
237
+ # install certificate
238
+ colorEcho ${BLUE} " Installing certificate"
239
+ ${sudoCmd} /root/.acme.sh/acme.sh --install-cert --ecc -d " $1 " \
240
+ --key-file /etc/ssl/v2ray/key.pem --fullchain-file /etc/ssl/v2ray/fullchain.pem \
241
+ --reloadcmd " chmod 644 /etc/ssl/v2ray/fullchain.pem; chmod 644 /etc/ssl/v2ray/key.pem; systemctl restart v2ray"
242
+
243
+ ${sudoCmd} restart caddy 2> /dev/null
244
+ }
245
+
231
246
get_trojan () {
232
247
if [ ! -d " /usr/bin/trojan-go" ]; then
233
248
colorEcho ${BLUE} " trojan-go is not installed. start installation"
@@ -819,7 +834,13 @@ install_v2ray() {
819
834
colorEcho ${GREEN} " 安装 VLESS + VMess + Trojan + NaiveProxy 成功!"
820
835
show_links
821
836
else
822
- colorEcho ${RED} " 证书签发失败, 请运行修复证书"
837
+ get_cert_alt " ${V2_DOMAIN} "
838
+ if [ -f " /root/.acme.sh/${V2_DOMAIN} _ecc/fullchain.cer" ]; then
839
+ colorEcho ${GREEN} " 安装 VLESS + VMess + Trojan + NaiveProxy 成功!"
840
+ show_links
841
+ else
842
+ colorEcho ${RED} " 证书签发失败, 请运行修复证书"
843
+ fi
823
844
fi
824
845
}
825
846
0 commit comments