~修复setconfig()函数变更带来的bug

This commit is contained in:
juewuy
2026-01-27 09:19:19 +08:00
parent 2b3720b8f3
commit 13b291ccc7
2 changed files with 3 additions and 3 deletions

View File

@@ -47,8 +47,8 @@ start)
/etc/init.d/shellcrash start
elif [ "$USER" = "root" ] && grep -q 'systemd' /proc/1/comm; then
FragmentPath=$(systemctl show -p FragmentPath shellcrash | sed 's/FragmentPath=//')
[ -f $FragmentPath ] && {
setconfig ExecStart "$COMMAND >/dev/null" "$FragmentPath"
[ -f "$FragmentPath" ] && {
sed -i "s#^ExecStart=.*#ExecStart=$COMMAND >/dev/null#" "$FragmentPath"
systemctl daemon-reload
}
systemctl start shellcrash.service || . "$CRASHDIR"/starts/start_error.sh