mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 03:32:34 +08:00
适配某些辣鸡机场的配置文件
This commit is contained in:
parent
fc80994cc5
commit
cb732fd3d7
|
@ -259,12 +259,13 @@ EOF
|
|||
#插入自定义规则
|
||||
sed -i "/#自定义规则/d" $tmpdir/config.yaml
|
||||
if [ -f $clashdir/rules.yaml ];then
|
||||
echo >> $clashdir/rules.yaml
|
||||
sed -i '/^$/d' $clashdir/rules.yaml && echo >> $clashdir/rules.yaml #处理换行
|
||||
space=$(sed -n '/^rules/{n;p}' $tmpdir/proxy.yaml | grep -oE '^\ *') #获取空格数
|
||||
while read line;do
|
||||
[ -z "$(echo "$line " | grep '#')" ] && \
|
||||
[ -n "$(echo "$line" | grep '\-\ ')" ] && \
|
||||
line=$(echo "$line" | sed 's#/#\\/#') && \
|
||||
sed -i "/^rules:/a\ $line #自定义规则" $tmpdir/config.yaml
|
||||
sed -i "/^rules:/a\\$space$line #自定义规则" $tmpdir/config.yaml
|
||||
done < $clashdir/rules.yaml
|
||||
fi
|
||||
#如果没有使用小闪存模式
|
||||
|
|
Loading…
Reference in New Issue
Block a user