From 12c6fe6331fe53b94cb43201c5c9e776d256858d Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:05:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=97=85=E6=AF=92=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD=20(#5817?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #5769 --- backend/app/service/clam.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/app/service/clam.go b/backend/app/service/clam.go index d1f70ed67..9989e7545 100644 --- a/backend/app/service/clam.go +++ b/backend/app/service/clam.go @@ -75,6 +75,10 @@ func (c *ClamService) LoadBaseInfo() (dto.ClamBaseInfo, error) { baseInfo.FreshIsExist = true baseInfo.FreshIsActive, _ = systemctl.IsActive(freshClamService) } + stdout, err := cmd.Exec("which clamdscan") + if err != nil || (len(strings.ReplaceAll(stdout, "\n", "")) == 0 && strings.HasPrefix(stdout, "/")) { + baseInfo.IsActive = false + } if baseInfo.IsActive { version, err := cmd.Exec("clamdscan --version")