feat: support update ClamAV databases (#747)

This commit is contained in:
SteveLauC
2024-03-19 14:10:47 +08:00
committed by GitHub
parent 351922c81f
commit d50360a69a
3 changed files with 11 additions and 0 deletions

View File

@@ -65,6 +65,7 @@ pub enum Step {
Chezmoi, Chezmoi,
Chocolatey, Chocolatey,
Choosenim, Choosenim,
ClamAvDb,
Composer, Composer,
Conda, Conda,
ConfigUpdate, ConfigUpdate,

View File

@@ -405,6 +405,7 @@ fn run() -> Result<()> {
runner.execute(Step::Bob, "Bob", || generic::run_bob(&ctx))?; runner.execute(Step::Bob, "Bob", || generic::run_bob(&ctx))?;
runner.execute(Step::Certbot, "Certbot", || generic::run_certbot(&ctx))?; runner.execute(Step::Certbot, "Certbot", || generic::run_certbot(&ctx))?;
runner.execute(Step::GitRepos, "Git Repositories", || git::run_git_pull(&ctx))?; runner.execute(Step::GitRepos, "Git Repositories", || git::run_git_pull(&ctx))?;
runner.execute(Step::ClamAvDb, "ClamAV Databases", || generic::run_freshclam(&ctx))?;
if should_run_powershell { if should_run_powershell {
runner.execute(Step::Powershell, "Powershell Modules Update", || { runner.execute(Step::Powershell, "Powershell Modules Update", || {

View File

@@ -931,3 +931,12 @@ pub fn run_certbot(ctx: &ExecutionContext) -> Result<()> {
cmd.status_checked() cmd.status_checked()
} }
/// Run `$ freshclam` to update ClamAV signature database
///
/// doc: https://docs.clamav.net/manual/Usage/SignatureManagement.html#freshclam
pub fn run_freshclam(ctx: &ExecutionContext) -> Result<()> {
let freshclam = require("freshclam")?;
print_separator("Update ClamAV Database(FreshClam)");
ctx.run_type().execute(freshclam).status_checked()
}