Skip to content

Commit

Permalink
Update install.sh
Browse files Browse the repository at this point in the history
acme cannot issue ssl cert try new way on that
  • Loading branch information
marxhehe authored Oct 21, 2021
1 parent e7138fd commit 3a1affa
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ OK="${Green}[OK]${Font}"
Error="${Red}[错误]${Font}"

# 版本
shell_version="1.1.8.4"
shell_version="1.1.5.7"
shell_mode="None"
github_branch="master"
version_cmp="/tmp/version_cmp.tmp"
Expand All @@ -41,8 +41,7 @@ nginx_dir="/etc/nginx"
web_dir="/home/wwwroot"
nginx_openssl_src="/usr/local/src"
v2ray_bin_dir_old="/usr/bin/v2ray"
v2ray_bin_dir="/usr/local/bin/v2ray"
v2ctl_bin_dir="/usr/local/bin/v2ctl"
v2ray_bin_dir="/usr/local/bin"
v2ray_info_file="$HOME/v2ray_info.inf"
v2ray_qr_config_file="/usr/local/vmess_qr.json"
nginx_systemd_file="/etc/systemd/system/nginx.service"
Expand All @@ -51,8 +50,8 @@ v2ray_access_log="/var/log/v2ray/access.log"
v2ray_error_log="/var/log/v2ray/error.log"
amce_sh_file="/root/.acme.sh/acme.sh"
ssl_update_file="/usr/bin/ssl_update.sh"
nginx_version="1.20.1"
openssl_version="1.1.1k"
nginx_version="1.18.0"
openssl_version="1.1.1g"
jemalloc_version="5.2.1"
old_config_status="off"
# v2ray_plugin_version="$(wget -qO- "https://github.com/shadowsocks/v2ray-plugin/tags" | grep -E "/shadowsocks/v2ray-plugin/releases/tag/" | head -1 | sed -r 's/.*tag\/v(.+)\">.*/\1/')"
Expand Down Expand Up @@ -223,8 +222,6 @@ dependency_install() {
systemctl start haveged && systemctl enable haveged
# judge "haveged 启动"
fi

mkdir -p /usr/local/bin >/dev/null 2>&1
}
basic_optimization() {
# 最大文件打开数
Expand Down Expand Up @@ -472,7 +469,6 @@ port_exist_check() {
fi
}
acme() {
"$HOME"/.acme.sh/acme.sh --set-default-ca --server letsencrypt
if "$HOME"/.acme.sh/acme.sh --issue -d "${domain}" --standalone -k ec-256 --force --test; then
echo -e "${OK} ${GreenBG} SSL 证书测试签发成功,开始正式签发 ${Font}"
rm -rf "$HOME/.acme.sh/${domain}_ecc"
Expand Down Expand Up @@ -827,17 +823,16 @@ mtproxy_sh() {

uninstall_all() {
stop_process_systemd
[[ -f $nginx_systemd_file ]] && rm -f $nginx_systemd_file
[[ -f $v2ray_systemd_file ]] && rm -f $v2ray_systemd_file
[[ -f $v2ray_bin_dir ]] && rm -f $v2ray_bin_dir
[[ -f $v2ctl_bin_dir ]] && rm -f $v2ctl_bin_dir
[[ -d $v2ray_bin_dir ]] && rm -rf $v2ray_bin_dir
[[ -d $v2ray_bin_dir_old ]] && rm -rf $v2ray_bin_dir_old
if [[ -d $nginx_dir ]]; then
echo -e "${OK} ${Green} 是否卸载 Nginx [Y/N]? ${Font}"
read -r uninstall_nginx
case $uninstall_nginx in
[yY][eE][sS] | [yY])
rm -rf $nginx_dir
rm -rf $nginx_systemd_file
echo -e "${OK} ${Green} 已卸载 Nginx ${Font}"
;;
*) ;;
Expand All @@ -846,26 +841,16 @@ uninstall_all() {
fi
[[ -d $v2ray_conf_dir ]] && rm -rf $v2ray_conf_dir
[[ -d $web_dir ]] && rm -rf $web_dir
echo -e "${OK} ${Green} 是否卸载acme.sh及证书 [Y/N]? ${Font}"
read -r uninstall_acme
case $uninstall_acme in
[yY][eE][sS] | [yY])
/root/.acme.sh/acme.sh --uninstall
rm -rf /root/.acme.sh
rm -rf /data/*
;;
*) ;;
esac
systemctl daemon-reload
echo -e "${OK} ${GreenBG} 已卸载 ${Font}"
echo -e "${OK} ${GreenBG} 已卸载,SSL证书文件已保留 ${Font}"
}
delete_tls_key_and_crt() {
[[ -f $HOME/.acme.sh/acme.sh ]] && /root/.acme.sh/acme.sh uninstall >/dev/null 2>&1
[[ -d $HOME/.acme.sh ]] && rm -rf "$HOME/.acme.sh"
echo -e "${OK} ${GreenBG} 已清空证书遗留文件 ${Font}"
}
judge_mode() {
if [ -f $v2ray_bin_dir ] || [ -f $v2ray_bin_dir_old/v2ray ]; then
if [ -f $v2ray_bin_dir/v2ray ] || [ -f $v2ray_bin_dir_old/v2ray ]; then
if grep -q "ws" $v2ray_qr_config_file; then
shell_mode="ws"
elif grep -q "h2" $v2ray_qr_config_file; then
Expand Down Expand Up @@ -1063,7 +1048,6 @@ menu() {
start_process_systemd
;;
14)
source '/etc/os-release'
uninstall_all
;;
15)
Expand All @@ -1083,3 +1067,4 @@ menu() {

judge_mode
list "$1"

0 comments on commit 3a1affa

Please sign in to comment.