Browse Source

feat: 病毒扫描增加状态判断 (#5817)

Refs #5769
pull/5824/head
ssongliu 4 months ago committed by GitHub
parent
commit
12c6fe6331
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      backend/app/service/clam.go

4
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")

Loading…
Cancel
Save