From c042bed0d20543e22dc076934bca602e932075da Mon Sep 17 00:00:00 2001 From: wulabing Date: Tue, 15 Jun 2021 14:15:53 +0800 Subject: [PATCH] Xray-1.3.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [fix] 修复部分系统无法正常安装 xray 的问题 [fix] 修复自签证书判断逻辑 [update] 视觉内容更新 --- install.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 0483c5e..dc50106 100644 --- a/install.sh +++ b/install.sh @@ -27,7 +27,7 @@ OK="${Green}[OK]${Font}" ERROR="${Red}[ERROR]${Font}" # 变量 -shell_version="1.3.2" +shell_version="1.3.3" github_branch="main" xray_conf_dir="/usr/local/etc/xray" website_dir="/www/xray_web/" @@ -186,6 +186,9 @@ function dependency_install() { wget -P /usr/bin https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/binary/jq && chmod +x /usr/bin/jq judge "安装 jq" fi + + # 防止部分系统xray的默认bin目录缺失 + mkdir /usr/local/bin >/dev/null 2>&1 } function basic_optimization() { @@ -374,7 +377,7 @@ function ssl_install() { # fi # judge "安装 SSL 证书生成脚本依赖" - read -rp "请输入用于注册域名的邮箱:" domain_email + read -rp "请输入用于注册域名的邮箱(eg:xxx@gmail.com):" domain_email curl https://get.acme.sh | sh -s email=$domain_email judge "安装 SSL 证书生成脚本" } @@ -441,8 +444,12 @@ function generate_certificate() { signedcert=$(xray tls cert -domain="$local_ip" -name="$local_ip" -org="$local_ip" -expire=87600h) echo $signedcert | jq '.certificate[]' | sed 's/\"//g' | tee $cert_dir/self_signed_cert.pem echo $signedcert | jq '.key[]' | sed 's/\"//g' > $cert_dir/self_signed_key.pem - openssl x509 -in $cert_dir/self_signed_cert.pem -noout || print_error "生成自签名证书失败" - print_ok "生成自签名证书成功" + if openssl x509 -in $cert_dir/self_signed_cert.pem -noout;then + print_ok "生成自签名证书成功" + else + print_error "生成自签名证书失败" + fi + chown nobody.$cert_group $cert_dir/self_signed_cert.pem chown nobody.$cert_group $cert_dir/self_signed_key.pem }