Skip to content

Commit

Permalink
Merge pull request #15 from bramanda48/develop
Browse files Browse the repository at this point in the history
Check fail2ban database connection
  • Loading branch information
bramanda48 authored May 13, 2024
2 parents 00e79bc + 151ce67 commit 63902f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/services/fail2ban/fail2ban.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export class Fail2banService extends BaseService {
}

public banIpAddress(ipAddress: string): Fail2banJail {
if (this.dbFail2ban.open) this.dbFail2ban.close();

const cmd = new Deno.Command("scripts/fail2ban-banned-ip.sh", {
args: [ipAddress],
});
Expand All @@ -39,6 +41,8 @@ export class Fail2banService extends BaseService {
}

public unbanIpAddress(ipAddress: string): Fail2banJail {
if (this.dbFail2ban.open) this.dbFail2ban.close();

const cmd = new Deno.Command("scripts/fail2ban-unbanned-ip.sh", {
args: [ipAddress],
});
Expand Down

0 comments on commit 63902f7

Please sign in to comment.