Reworked output fot block_shitty_ip ()
This commit is contained in:
parent
ea5fe14d11
commit
bc841b15dd
1 changed files with 2 additions and 1 deletions
|
@ -42,7 +42,7 @@ function is_host_present {
|
|||
function block_shitty_ip {
|
||||
param($ip)
|
||||
Write-Host -ForegroundColor white -NoNewline "Blacklist IP $ip : "
|
||||
if ( Get-NetFirewallRule -Name Blacklist_$ip) {
|
||||
if ( Get-NetFirewallRule -Name Blacklist_$ip -ErrorAction SilentlyContinue) {
|
||||
Write-Host -ForegroundColor Yellow "Already blacklisted"
|
||||
return
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ function block_shitty_ip {
|
|||
Write-Host -Nonewline -ForegroundColor Red " Error "
|
||||
return
|
||||
}
|
||||
Write-Host -ForegroundColor Green " Done"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue