~拆分脚本,大幅度优化结构

This commit is contained in:
juewuy
2025-12-21 22:11:05 +08:00
parent 1ed156f724
commit bf55553d63
18 changed files with 4922 additions and 3663 deletions

View File

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