diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index 282ea24..ecafc60 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/version b/bin/version index 9c843d0..cea7fc1 100644 --- a/bin/version +++ b/bin/version @@ -3,4 +3,4 @@ clashpre_v=2021.09.15 clash_v=v1.7.1 meta_v=v1.12.0 GeoIP_v=20220920 -versionsh=1.6.4 +versionsh=1.6.5 diff --git a/install.sh b/install.sh index e9acf32..c47e48c 100644 --- a/install.sh +++ b/install.sh @@ -26,7 +26,7 @@ setconfig(){ [ -f "/jffs/.asusrouter" ] && initdir='/jffs/.asusrouter' [ -d "/jffs/scripts" ] && initdir='/jffs/scripts/nat-start' } -[ -f "/data/etc/crontabs/root" ] && systype=mi_wifi #小米设备 +[ -f "/data/etc/crontabs/root" ] && systype=mi_snapshot #小米设备 #检查root权限 if [ "$USER" != "root" -a -z "$systype" ];then echo 当前用户:$USER @@ -144,7 +144,7 @@ gettar(){ setconfig initdir $initdir } #小米镜像化OpenWrt额外设置 - if [ "$systype" = "mi_wifi" ];then + if [ "$systype" = "mi_snapshot" ];then chmod 755 $clashdir/misnap_init.sh uci set firewall.ShellClash=include uci set firewall.ShellClash.type='script' @@ -193,7 +193,7 @@ setdir(){ echo ----------------------------------------------- if [ -n "$systype" ];then [ "$systype" = "Padavan" ] && dir=/etc/storage - [ "$systype" = "mi_wifi" ] && { + [ "$systype" = "mi_snapshot" ] && { $echo "\033[33m检测到当前设备为小米官方系统,请选择安装位置\033[0m" $echo " 1 安装到/data目录(推荐,支持软固化功能)" $echo " 2 安装到USB设备(支持软固化功能)" diff --git a/scripts/start.sh b/scripts/start.sh index 25ca5c2..f75bc93 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -405,7 +405,7 @@ EOF space=$(sed -n '/^proxy-groups:/{n;p}' $tmpdir/config.yaml | grep -oE '^\ *') #获取原始配置空格数 if [ -f $clashdir/proxy-groups.yaml ];then c_space=$(sed -n '/^proxy-groups:/{n;p}' $clashdir/proxy-groups.yaml | grep -oE '^\ *') #获取自定义配置空格数 - sed -i "s/$c_space/$space/g" $clashdir/proxy-groups.yaml && echo >> $clashdir/proxy-groups.yaml #处理缩进空格数 + [ -n "$c_space" ] && sed -i "s/$c_space/$space/g" $clashdir/proxy-groups.yaml && echo >> $clashdir/proxy-groups.yaml #处理缩进空格数 sed -i '/^$/d' $clashdir/proxy-groups.yaml && echo >> $clashdir/proxy-groups.yaml #处理换行 cat $clashdir/proxy-groups.yaml | awk '{array[NR]=$0} END { for(i=NR;i>0;i--){print array[i];} }' | while IFS= read line;do [ -z "$(echo "$line" | grep '^proxy-groups:')" ] && \