Skip to content

Commit

Permalink
refactor: Register Snort as a scheduled task to run at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
bengo237 committed Sep 11, 2024
1 parent 608ca71 commit f26ae18
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/windows/snort.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,15 @@ function Install-Snort {
Write-Host "Failed to download snort.conf file."
}

#delete temp directory
# Delete temp directory
Remove-Item -Path $tempDir -Recurse -Force

# Register Snort as a scheduled task to run at startup
$taskName = "SnortStartup"
$taskAction = New-ScheduledTaskAction -Execute "C:\Snort\bin\snort.exe" -Argument "-c C:\Snort\etc\snort.conf -A full -l C:\Snort\log\ -i 5 -A console"
$taskTrigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName $taskName -Action $taskAction -Trigger $taskTrigger -RunLevel Highest

Write-Host "Installation and configuration completed!"
}

Expand Down

0 comments on commit f26ae18

Please sign in to comment.