v1.6.4
~适配华硕官方固件(自启需插入任意USB设备) ~优化梅林固件自启逻辑 ~优化小米设备安装目录选择 ~增加安装到外置存储选项 ~修复部分设备时间显示异常的bug ~修复部分设备环境变量配置重复的bug
This commit is contained in:
Binary file not shown.
@@ -1325,7 +1325,7 @@ tools(){
|
||||
if [ "$mi_autoSSH" = "已启用" ];then
|
||||
mi_autoSSH=禁用
|
||||
else
|
||||
if [ "$systype" = "mi_snapshot" ];then
|
||||
if [ "$systype" = "mi_snapshot" -o "$systype" = "mi_snapshot" ];then
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33m本功能使用软件命令进行固化不保证100%成功!\033[0m"
|
||||
echo -e "本功能需依赖clash服务,请确保clash为开机启动状态!"
|
||||
|
||||
@@ -371,17 +371,18 @@ EOF
|
||||
#合并文件
|
||||
[ -f $clashdir/user.yaml ] && yaml_user=$clashdir/user.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
|
||||
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
|
||||
sed -i '/^$/d' $clashdir/rules.yaml && echo >> $clashdir/rules.yaml #处理换行
|
||||
while read line;do
|
||||
[ -z "$(echo "$line" | grep '#')" ] && \
|
||||
[ -n "$(echo "$line" | grep '\-\ ')" ] && \
|
||||
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
|
||||
fi
|
||||
|
||||
@@ -417,7 +418,7 @@ EOF
|
||||
|
||||
#tun/fake-ip防止流量回环
|
||||
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
|
||||
#如果没有使用小闪存模式
|
||||
if [ "$tmpdir" != "$bindir" ];then
|
||||
|
||||
Reference in New Issue
Block a user