~重写Geo文件检测逻辑

~优化singbox内核本机hosts功能
~修复部分grep相关报错
~优化tar.gz格式内核解压流程
This commit is contained in:
juewuy
2024-02-03 18:55:45 +08:00
parent 9cfa4cb6c6
commit 5ec99ebcff
4 changed files with 35 additions and 95 deletions

View File

@@ -902,8 +902,7 @@ getcore(){ #下载内核文件
[ -f ${TMPDIR}/core_new.tar.gz ] && {
mkdir -p ${TMPDIR}/core_tmp
tar -zxf "${TMPDIR}/core_new.tar.gz" -C ${TMPDIR}/core_tmp/ &>/dev/null || tar -zxf "${TMPDIR}/core_new.tar.gz" --no-same-owner -C ${TMPDIR}/core_tmp/
files=$(find ${TMPDIR}/core_tmp 2>/dev/null)
for file in $files ;do
for file in $(find ${TMPDIR}/core_tmp 2>/dev/null);do
[ -s $file ] && [ -n "$(echo $file | sed 's#.*/##' | grep -iE '(CrashCore|sing|meta|mihomo|clash|premium)')" ] && mv -f $file ${TMPDIR}/core_new
done
rm -rf ${TMPDIR}/core_tmp