~修复部分情况下向systemd输出大量无用日志的bug

~修复首次使用6-2时倒入失败的bug
~尝试修复部分设备因ipv6导致的dns劫持失败的问题
This commit is contained in:
juewuy
2024-04-21 14:04:59 +08:00
parent 7a6b7a7e5a
commit 00f10b81f9
3 changed files with 8 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ source ${CRASHDIR}/configs/command.env 2>/dev/null
setconfig(){
#参数1代表变量名参数2代表变量值,参数3即文件路径
[ -z "$3" ] && configpath=${CFG_PATH} || configpath="${3}"
[ -n "$(grep "${1}=" "$configpath")" ] && sed -i "s#${1}=.*#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath
grep -q "${1}=" "$configpath" && sed -i "s#${1}=.*#${1}=${2}#g" $configpath || sed -i "\$a\\${1}=${2}" $configpath
}
ckcmd(){
command -v sh >/dev/null 2>&1 && command -v $1 >/dev/null 2>&1 || type $1 >/dev/null 2>&1