v1.6.5
~适配华硕官方固件(自启需插入任意USB设备) ~优化梅林固件自启逻辑 ~优化小米设备安装目录选择 ~增加安装到外置存储选项 ~修复部分设备时间显示异常的bug ~修复部分设备环境变量配置重复的bug ~修复若干小bug
This commit is contained in:
Binary file not shown.
@@ -3,4 +3,4 @@ clashpre_v=2021.09.15
|
|||||||
clash_v=v1.7.1
|
clash_v=v1.7.1
|
||||||
meta_v=v1.12.0
|
meta_v=v1.12.0
|
||||||
GeoIP_v=20220920
|
GeoIP_v=20220920
|
||||||
versionsh=1.6.4
|
versionsh=1.6.5
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ setconfig(){
|
|||||||
[ -f "/jffs/.asusrouter" ] && initdir='/jffs/.asusrouter'
|
[ -f "/jffs/.asusrouter" ] && initdir='/jffs/.asusrouter'
|
||||||
[ -d "/jffs/scripts" ] && initdir='/jffs/scripts/nat-start'
|
[ -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权限
|
#检查root权限
|
||||||
if [ "$USER" != "root" -a -z "$systype" ];then
|
if [ "$USER" != "root" -a -z "$systype" ];then
|
||||||
echo 当前用户:$USER
|
echo 当前用户:$USER
|
||||||
@@ -144,7 +144,7 @@ gettar(){
|
|||||||
setconfig initdir $initdir
|
setconfig initdir $initdir
|
||||||
}
|
}
|
||||||
#小米镜像化OpenWrt额外设置
|
#小米镜像化OpenWrt额外设置
|
||||||
if [ "$systype" = "mi_wifi" ];then
|
if [ "$systype" = "mi_snapshot" ];then
|
||||||
chmod 755 $clashdir/misnap_init.sh
|
chmod 755 $clashdir/misnap_init.sh
|
||||||
uci set firewall.ShellClash=include
|
uci set firewall.ShellClash=include
|
||||||
uci set firewall.ShellClash.type='script'
|
uci set firewall.ShellClash.type='script'
|
||||||
@@ -193,7 +193,7 @@ setdir(){
|
|||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
if [ -n "$systype" ];then
|
if [ -n "$systype" ];then
|
||||||
[ "$systype" = "Padavan" ] && dir=/etc/storage
|
[ "$systype" = "Padavan" ] && dir=/etc/storage
|
||||||
[ "$systype" = "mi_wifi" ] && {
|
[ "$systype" = "mi_snapshot" ] && {
|
||||||
$echo "\033[33m检测到当前设备为小米官方系统,请选择安装位置\033[0m"
|
$echo "\033[33m检测到当前设备为小米官方系统,请选择安装位置\033[0m"
|
||||||
$echo " 1 安装到/data目录(推荐,支持软固化功能)"
|
$echo " 1 安装到/data目录(推荐,支持软固化功能)"
|
||||||
$echo " 2 安装到USB设备(支持软固化功能)"
|
$echo " 2 安装到USB设备(支持软固化功能)"
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ EOF
|
|||||||
space=$(sed -n '/^proxy-groups:/{n;p}' $tmpdir/config.yaml | grep -oE '^\ *') #获取原始配置空格数
|
space=$(sed -n '/^proxy-groups:/{n;p}' $tmpdir/config.yaml | grep -oE '^\ *') #获取原始配置空格数
|
||||||
if [ -f $clashdir/proxy-groups.yaml ];then
|
if [ -f $clashdir/proxy-groups.yaml ];then
|
||||||
c_space=$(sed -n '/^proxy-groups:/{n;p}' $clashdir/proxy-groups.yaml | grep -oE '^\ *') #获取自定义配置空格数
|
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 #处理换行
|
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
|
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:')" ] && \
|
[ -z "$(echo "$line" | grep '^proxy-groups:')" ] && \
|
||||||
|
|||||||
Reference in New Issue
Block a user