From 399928f6ea953461a3d8e0fc4b31b6df0e2fef6b Mon Sep 17 00:00:00 2001 From: juewuy Date: Tue, 27 Jan 2026 09:30:50 +0800 Subject: [PATCH] =?UTF-8?q?~=E4=BF=AE=E5=A4=8D=E5=B0=8F=E7=B1=B3=E8=BD=AF?= =?UTF-8?q?=E5=9B=BA=E5=8C=96=E5=8F=8A=E8=87=AA=E5=90=AF=E5=8A=A8=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/starts/snapshot_init.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/starts/snapshot_init.sh b/scripts/starts/snapshot_init.sh index 3001edfd..51196be4 100644 --- a/scripts/starts/snapshot_init.sh +++ b/scripts/starts/snapshot_init.sh @@ -57,10 +57,12 @@ auto_clean(){ } auto_start(){ #设置init.d服务 - cp -f "$CRASHDIR"/starts/shellcrash.procd /etc/init.d/shellcrash - chmod 755 /etc/init.d/shellcrash + [ ! -x /etc/init.d/shellcrash ] && { + cp -f "$CRASHDIR"/starts/shellcrash.procd /etc/init.d/shellcrash + chmod 755 /etc/init.d/shellcrash + } #初始化环境变量 - . "$CRASHDIR"/libs/set_profile.sh && set_profile '/etc/profile' + grep -q '^export CRASHDIR=' '/etc/profile' && . "$CRASHDIR"/libs/set_profile.sh && set_profile '/etc/profile' #启动服务 if [ ! -f "$CRASHDIR"/.dis_startup ]; then #AX6S/AX6000修复tun功能 @@ -70,13 +72,9 @@ auto_start(){ #自动覆盖根证书文件 [ -s "$CRASHDIR"/tools/ca-certificates.crt ] && cp -f "$CRASHDIR"/tools/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt #启动服务 - "$CRASHDIR"/start.sh start - /etc/init.d/shellcrash enable + "$CRASHDIR"/start.sh stop + /etc/init.d/shellcrash start && /etc/init.d/shellcrash enable fi - #启动自定义服务 - [ -s /data/auto_start.sh ] && /bin/sh /data/auto_start.sh & - #兼容auto_ssh脚本 - [ -s /data/auto_ssh/auto_ssh.sh ] && /bin/sh /data/auto_ssh/auto_ssh.sh & } init(){ #等待启动完成 @@ -85,7 +83,11 @@ init(){ done autoSSH #软固化功能 auto_clean #自动清理 - [ -s "$CRASHDIR"/start.sh ] && [ ! -x /etc/init.d/shellcrash ] && auto_start + auto_start + #启动自定义服务 + [ -s /data/auto_start.sh ] && /bin/sh /data/auto_start.sh & + #兼容auto_ssh脚本 + [ -s /data/auto_ssh/auto_ssh.sh ] && /bin/sh /data/auto_ssh/auto_ssh.sh & } case "$1" in