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