~适配华硕官方固件(自启需插入任意USB设备)
~优化梅林固件自启逻辑
~优化小米设备安装目录选择
~增加安装到外置存储选项
~修复部分设备时间显示异常的bug
~修复部分设备环境变量配置重复的bug
This commit is contained in:
juewuy
2022-09-22 21:42:25 +08:00
parent 7fef15b4a8
commit 27e6563d2c
3 changed files with 6 additions and 5 deletions

Binary file not shown.

View File

@@ -1325,7 +1325,7 @@ tools(){
if [ "$mi_autoSSH" = "已启用" ];then if [ "$mi_autoSSH" = "已启用" ];then
mi_autoSSH=禁用 mi_autoSSH=禁用
else else
if [ "$systype" = "mi_snapshot" ];then if [ "$systype" = "mi_snapshot" -o "$systype" = "mi_snapshot" ];then
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[33m本功能使用软件命令进行固化不保证100%成功!\033[0m" echo -e "\033[33m本功能使用软件命令进行固化不保证100%成功!\033[0m"
echo -e "本功能需依赖clash服务请确保clash为开机启动状态" echo -e "本功能需依赖clash服务请确保clash为开机启动状态"

View File

@@ -371,17 +371,18 @@ EOF
#合并文件 #合并文件
[ -f $clashdir/user.yaml ] && yaml_user=$clashdir/user.yaml [ -f $clashdir/user.yaml ] && yaml_user=$clashdir/user.yaml
[ -f $tmpdir/hosts.yaml ] && yaml_hosts=$tmpdir/hosts.yaml [ -f $tmpdir/hosts.yaml ] && yaml_hosts=$tmpdir/hosts.yaml
cut -c 1- $tmpdir/set.yaml $yaml_hosts $yaml_user $tmpdir/proxy.yaml > $tmpdir/config.yaml [ -f $tmpdir/proxy.yaml ] && yaml_proxy=$tmpdir/proxy.yaml
cut -c 1- $tmpdir/set.yaml $yaml_hosts $yaml_user $yaml_proxy > $tmpdir/config.yaml
#插入自定义规则 #插入自定义规则
sed -i "/#自定义规则/d" $tmpdir/config.yaml sed -i "/#自定义规则/d" $tmpdir/config.yaml
space=$(sed -n '/^rules/{n;p}' $tmpdir/proxy.yaml | grep -oE '^\ *') #获取空格数 space_rules=$(sed -n '/^rules/{n;p}' $tmpdir/proxy.yaml | grep -oE '^\ *') #获取空格数
if [ -f $clashdir/rules.yaml ];then if [ -f $clashdir/rules.yaml ];then
sed -i '/^$/d' $clashdir/rules.yaml && echo >> $clashdir/rules.yaml #处理换行 sed -i '/^$/d' $clashdir/rules.yaml && echo >> $clashdir/rules.yaml #处理换行
while read line;do while read line;do
[ -z "$(echo "$line" | grep '#')" ] && \ [ -z "$(echo "$line" | grep '#')" ] && \
[ -n "$(echo "$line" | grep '\-\ ')" ] && \ [ -n "$(echo "$line" | grep '\-\ ')" ] && \
line=$(echo "$line" | sed 's#/#\\/#') && \ line=$(echo "$line" | sed 's#/#\\/#') && \
sed -i "/^rules:/a\\$space$line #自定义规则" $tmpdir/config.yaml sed -i "/^rules:/a\\$space_rules$line #自定义规则" $tmpdir/config.yaml
done < $clashdir/rules.yaml done < $clashdir/rules.yaml
fi fi
@@ -417,7 +418,7 @@ EOF
#tun/fake-ip防止流量回环 #tun/fake-ip防止流量回环
if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" -o "$dns_mod" = "fake-ip" ];then if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" -o "$dns_mod" = "fake-ip" ];then
sed -i "/^rules:/a\\$space- SRC-IP-CIDR,198.18.0.0/16,REJECT #自定义规则(防止回环)" $tmpdir/config.yaml sed -i "/^rules:/a\\$space_rules- SRC-IP-CIDR,198.18.0.0/16,REJECT #自定义规则(防止回环)" $tmpdir/config.yaml
fi fi
#如果没有使用小闪存模式 #如果没有使用小闪存模式
if [ "$tmpdir" != "$bindir" ];then if [ "$tmpdir" != "$bindir" ];then