Skip to content

Commit

Permalink
feat: support update ClamAV databases (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC authored Mar 19, 2024
1 parent 351922c commit d50360a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub enum Step {
Chezmoi,
Chocolatey,
Choosenim,
ClamAvDb,
Composer,
Conda,
ConfigUpdate,
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ fn run() -> Result<()> {
runner.execute(Step::Bob, "Bob", || generic::run_bob(&ctx))?;
runner.execute(Step::Certbot, "Certbot", || generic::run_certbot(&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 {
runner.execute(Step::Powershell, "Powershell Modules Update", || {
Expand Down
9 changes: 9 additions & 0 deletions src/steps/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -931,3 +931,12 @@ pub fn run_certbot(ctx: &ExecutionContext) -> Result<()> {

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()
}

0 comments on commit d50360a

Please sign in to comment.