~优化nftables检测机制

~优化小闪存模式内存占用
~修复并屏蔽因部分linux系统不支持&>写法而导致的大量无效输出
~修复singbox的ntp服务
~尝试修复部分linux设备因selinux导致使用systemd启动服务失败的问题
~优化crash -d命令debug功能
This commit is contained in:
juewuy
2024-02-04 16:55:06 +08:00
parent 905bcc8769
commit a6c254e183
5 changed files with 58 additions and 57 deletions

View File

@@ -6,7 +6,7 @@
[ -z "$BINDIR" ] && BINDIR=${CRASHDIR}
CFG_PATH=${CRASHDIR}/configs/ShellCrash.cfg
TMPDIR=/tmp/ShellCrash && [ ! -f ${TMPDIR} ] && mkdir -p ${TMPDIR}
source $CFG_PATH &> /dev/null
source $CFG_PATH >/dev/null 2>&1
[ -n "$(tar --help 2>&1|grep -o 'no-same-owner')" ] && tar_para='--no-same-owner' #tar命令兼容
setconfig(){
@@ -15,7 +15,7 @@ setconfig(){
[ -n "$(grep ${1} $configpath)" ] && sed -i "s#${1}=.*#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath
}
ckcmd(){ #检查命令是否存在
command -v sh &>/dev/null && command -v $1 &>/dev/null || type $1 &>/dev/null
command -v sh >/dev/null 2>&1 && command -v $1 >/dev/null 2>&1 || type $1 >/dev/null 2>&1
}
#任务命令
@@ -148,7 +148,7 @@ reset_firewall(){ #重设透明路由防火墙
${CRASHDIR}/start.sh afstart
}
ntp(){
[ "$crashcore" != singbox ] && ckcmd ntpd && ntpd -n -q -p 203.107.6.88 &>/dev/null || exit 0 &
[ "$crashcore" != singbox ] && ckcmd ntpd && ntpd -n -q -p 203.107.6.88 >/dev/null 2>&1 || exit 0 &
}
#任务工具