diff --git a/README.md b/README.md index 27dfb5c..0778ca8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # V2Ray 基于 Nginx 的 vmess+ws+tls 一键安装脚本 (Use Path) -> 近期将适配Centos8,并处理 nginx 安装部分的 bug +### 2019-10-17 + +> 建议遇到问题的用户重置系统后重新安装 + +* 变更 添加 Nginx systemd serverfile +* 修复 又双叒叕尝试修复 Nginx 开机自启动问题 ### 2019-10-16 @@ -77,9 +82,9 @@ bash <(curl -L -s https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_o 停止 V2ray:`systemctl stop v2ray` -启动 Nginx:`/etc/nginx/sbin/nginx` +启动 Nginx:`systemctl start nginx` -停止 Nginx:`/etc/nginx/sbin/nginx -s stop` +停止 Nginx:`systemctl stop nginx` (其他的应该不用我多说了吧 嘿嘿嘿) diff --git a/install.sh b/install.sh index 242c2f7..08e8565 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ # System Request:Debian 9+/Ubuntu 18.04+/Centos 7+ # Author: wulabing # Dscription: V2ray ws+tls onekey -# Version: 5.0 +# Version: 5.1 # email:wulabing@admin.com # Official document: www.v2ray.com #==================================================== @@ -305,7 +305,7 @@ domain_check(){ echo -e "${OK} ${GreenBG} 域名dns解析IP 与 本机IP 匹配 ${Font}" sleep 2 else - echo -e "${Error} ${RedBG} 请确保域名添加了正确的 A 记录,否则将无法正常使用 V2ray(y/n)" + echo -e "${Error} ${RedBG} 请确保域名添加了正确的 A 记录,否则将无法正常使用 V2ray" echo -e "${Error} ${RedBG} 域名dns解析IP 与 本机IP 不匹配 是否继续安装?(y/n)${Font}" && read install case $install in [yY][eE][sS]|[yY]) @@ -393,11 +393,10 @@ judge "Nginx 配置修改" start_process_systemd(){ ### nginx服务在安装完成后会自动启动。需要通过restart或reload重新加载配置 - ${nginx_dir}/sbin/nginx + systemctl restart nginx judge "Nginx 启动" - sed -i '/nginx/d' /etc/rc.local - echo "${nginx_dir}/sbin/nginx" >> /etc/rc.local + systemctl enable nginx judge "设置 Nginx 开机自启" systemctl restart v2ray @@ -408,24 +407,24 @@ start_process_systemd(){ } #debian 系 9 10 适配 -rc_local_initialization(){ - if [[ -f /etc/rc.local ]];then - chmod +x /etc/rc.local - else - touch /etc/rc.local && chmod +x /etc/rc.local - echo "#!/bin/bash" >> /etc/rc.local - systemctl start rc-local - fi - - judge "rc.local 配置" -} +#rc_local_initialization(){ +# if [[ -f /etc/rc.local ]];then +# chmod +x /etc/rc.local +# else +# touch /etc/rc.local && chmod +x /etc/rc.local +# echo "#!/bin/bash" >> /etc/rc.local +# systemctl start rc-local +# fi +# +# judge "rc.local 配置" +#} acme_cron_update(){ if [[ "${ID}" == "centos" ]];then - sed -i "/acme.sh/c 0 0 * * 0 /etc/nginx/sbin/nginx -s stop && \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ - > /dev/null && /etc/nginx/sbin/nginx" /var/spool/cron/root + sed -i "/acme.sh/c 0 0 * * 0 systemctl stop nginx && \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ + > /dev/null && systemctl start nginx" /var/spool/cron/root else - sed -i "/acme.sh/c 0 0 * * 0 /etc/nginx/sbin/nginx -s stop && \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ - > /dev/null && /etc/nginx/sbin/nginx" /var/spool/cron/crontabs/root + sed -i "/acme.sh/c 0 0 * * 0 systemctl stop nginx && \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ + > /dev/null && systemctl start nginx" /var/spool/cron/crontabs/root fi judge "cron 计划任务更新" } @@ -484,6 +483,26 @@ ssl_judge_and_install(){ acme fi } +nginx_systemd(){ + cat>/lib/systemd/system/nginx.service<