~修复部分小米设备开机启动失败的bug
~修复安装时提示找不到task.sh文件的bug
~修复部分小米设备重启后依然需要输入clash命令的bug
This commit is contained in:
juewuy
2024-01-03 18:15:07 +08:00
parent d45d8ede5a
commit 4d66cbbf0e
5 changed files with 6 additions and 6 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -3,4 +3,4 @@ clashpre_v=2022.11.25
clash_v=v1.7.1 clash_v=v1.7.1
meta_v=v1.17.0 meta_v=v1.17.0
GeoIP_v=20231230 GeoIP_v=20231230
versionsh=1.8.2h versionsh=1.8.2i

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
version=1.8.2h version=1.8.2i
setdir(){ setdir(){
dir_avail(){ dir_avail(){
@@ -178,7 +178,6 @@ fi
type bash &>/dev/null && shtype=bash || shtype=sh type bash &>/dev/null && shtype=bash || shtype=sh
sed -i "s|/bin/sh|/bin/$shtype|" $CRASHDIR/start.sh sed -i "s|/bin/sh|/bin/$shtype|" $CRASHDIR/start.sh
chmod 755 $CRASHDIR/start.sh chmod 755 $CRASHDIR/start.sh
chmod 755 $CRASHDIR/task.sh
setconfig versionsh_l $version setconfig versionsh_l $version
#设置更新地址 #设置更新地址
[ -n "$url" ] && setconfig update_url $url [ -n "$url" ] && setconfig update_url $url
@@ -254,6 +253,7 @@ done
for file in cron task.sh task.list;do for file in cron task.sh task.list;do
mv -f $CRASHDIR/$file $CRASHDIR/task/$file 2>/dev/null mv -f $CRASHDIR/$file $CRASHDIR/task/$file 2>/dev/null
done done
chmod 755 $CRASHDIR/task/task.sh
for file in log clash.service mark? mark.bak;do for file in log clash.service mark? mark.bak;do
rm -rf $CRASHDIR/$file rm -rf $CRASHDIR/$file
done done

View File

@@ -50,9 +50,9 @@ init(){
[ -n "$(grep 'init complete' $log_file)" ] && i=20 || i=$((i + 1)) [ -n "$(grep 'init complete' $log_file)" ] && i=20 || i=$((i + 1))
done done
#初始化环境变量 #初始化环境变量
sed -i "/alias clash/d" $profile sed -i "/alias crash/d" $profile
sed -i "/export CRASHDIR/d" $profile sed -i "/export CRASHDIR/d" $profile
echo "alias clash=\"$CRASHDIR/clash.sh\"" >>$profile echo "alias crash=\"$CRASHDIR/clash.sh\"" >>$profile
echo "export CRASHDIR=\"$CRASHDIR\"" >>$profile echo "export CRASHDIR=\"$CRASHDIR\"" >>$profile
#软固化功能 #软固化功能
autoSSH autoSSH
@@ -64,7 +64,7 @@ init(){
#AX6S/AX6000修复tun功能 #AX6S/AX6000修复tun功能
[ -f $CRASHDIR/configs/tun.ko ] && tunfix [ -f $CRASHDIR/configs/tun.ko ] && tunfix
#小米7000/小米万兆修复tproxy #小米7000/小米万兆修复tproxy
[ -f /etc/init.d/qca-nss-ecm ] && [ -n "$(grep 'redir_mod=Tproxy' $CRASHDIR/configs/ShellClash.cfg )" ] && tproxyfix [ -f /etc/init.d/qca-nss-ecm ] && [ -n "$(grep 'redir_mod=Tproxy' $CRASHDIR/configs/ShellCrash.cfg )" ] && tproxyfix
#启动服务 #启动服务
/etc/init.d/clash start /etc/init.d/clash start
/etc/init.d/clash enable /etc/init.d/clash enable