From 13b291ccc75257b05d105d41d8585aec57a0a4db Mon Sep 17 00:00:00 2001 From: juewuy Date: Tue, 27 Jan 2026 09:19:19 +0800 Subject: [PATCH] =?UTF-8?q?~=E4=BF=AE=E5=A4=8Dsetconfig()=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=8F=98=E6=9B=B4=E5=B8=A6=E6=9D=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/init.sh | 2 +- scripts/start.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/init.sh b/scripts/init.sh index d5535529..800c4fcf 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -130,7 +130,7 @@ if [ "$systype" = "mi_snapshot" -o "$systype" = "ng_snapshot" ]; then chmod 755 "$CRASHDIR"/starts/snapshot_init.sh if [ "$systype" = "mi_snapshot" ];then path="/data/shellcrash_init.sh" - setconfig CRASHDIR "$CRASHDIR" "$CRASHDIR"/starts/snapshot_init.sh + sed -i "s#^CRASHDIR=.*#CRASHDIR=$CRASHDIR#" "$CRASHDIR"/starts/snapshot_init.sh mv -f "$CRASHDIR"/starts/snapshot_init.sh "$path" [ ! -f /data/auto_start.sh ] && echo '#用于自定义需要开机启动的功能或者命令,会在开机后自动运行' > /data/auto_start.sh else diff --git a/scripts/start.sh b/scripts/start.sh index e9ee6403..7c60cf8d 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -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