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

Refs #5769
pull/5824/head
ssongliu 2024-07-15 12:05:26 +08:00 committed by GitHub
parent eb4d550305
commit 12c6fe6331
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

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