mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-12 16:31:25 +00:00
~修复小米软固化及自启动失败的bug
This commit is contained in:
@@ -57,10 +57,12 @@ auto_clean(){
|
|||||||
}
|
}
|
||||||
auto_start(){
|
auto_start(){
|
||||||
#设置init.d服务
|
#设置init.d服务
|
||||||
|
[ ! -x /etc/init.d/shellcrash ] && {
|
||||||
cp -f "$CRASHDIR"/starts/shellcrash.procd /etc/init.d/shellcrash
|
cp -f "$CRASHDIR"/starts/shellcrash.procd /etc/init.d/shellcrash
|
||||||
chmod 755 /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
|
if [ ! -f "$CRASHDIR"/.dis_startup ]; then
|
||||||
#AX6S/AX6000修复tun功能
|
#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
|
[ -s "$CRASHDIR"/tools/ca-certificates.crt ] && cp -f "$CRASHDIR"/tools/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
#启动服务
|
#启动服务
|
||||||
"$CRASHDIR"/start.sh start
|
"$CRASHDIR"/start.sh stop
|
||||||
/etc/init.d/shellcrash enable
|
/etc/init.d/shellcrash start && /etc/init.d/shellcrash enable
|
||||||
fi
|
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(){
|
init(){
|
||||||
#等待启动完成
|
#等待启动完成
|
||||||
@@ -85,7 +83,11 @@ init(){
|
|||||||
done
|
done
|
||||||
autoSSH #软固化功能
|
autoSSH #软固化功能
|
||||||
auto_clean #自动清理
|
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
|
case "$1" in
|
||||||
|
|||||||
Reference in New Issue
Block a user