~重写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

@@ -50,8 +50,8 @@ update_core(){ #自动更新内核
[ -f ${TMPDIR}/core_new.tar.gz ] && {
mkdir -p ${TMPDIR}/core_new
tar -zxf "${TMPDIR}/core_new.tar.gz" -C ${TMPDIR}/core_new/ &>/dev/null || tar -zxf "${TMPDIR}/core_new.tar.gz" --no-same-owner -C ${TMPDIR}/core_new/
for file in "$(ls -1 ${TMPDIR}/core_new | grep -iE 'CrashCore|sing-box|clash|mihomo|meta')" ;do
mv -f ${TMPDIR}/core_new/$file ${TMPDIR}/core_new
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_new
}