~重写了webget函数,改为优先使用wget命令

~修复setconfig函数式可能导致错误设定的bug
~修复在线获取配置文件功能报错的bug
This commit is contained in:
juewuy
2025-12-16 09:52:34 +08:00
parent cc607ae2b2
commit b5648b0d8d
3 changed files with 49 additions and 41 deletions

View File

@@ -153,7 +153,7 @@ setconfig() { #脚本配置工具
#参数1代表变量名参数2代表变量值,参数3即文件路径
[ -z "$3" ] && configpath="$CRASHDIR"/configs/ShellCrash.cfg || configpath="${3}"
if grep -q "^${1}=" "$configpath"; then
sed -i "s#${1}=.*#${1}=${2}#g" "$configpath"
sed -i "s#^${1}=.*#${1}=${2}#g" "$configpath"
else
printf '%s=%s\n' "$1" "$2" >>"$configpath"
fi