Skip to content

Commit a764682

Browse files
author
magnussolution
committed
fix fail2ban menu
1 parent eed0de4 commit a764682

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

build/MagnusBilling-current.tar.gz

3.14 KB
Binary file not shown.

protected/controllers/FirewallController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,21 @@ public function readStatus()
3333

3434
$this->getLinesCommand('asterisk-iptables', 0);
3535
$this->getLinesCommand('ip-blacklist', 1);
36-
$this->getLinesCommand('ssh-iptables', 0);
36+
if ($this->getLinesCommand('ssh-iptables', 0) == false) {
37+
$this->getLinesCommand('sshd', 0);
38+
39+
}
40+
3741
$this->getLinesCommand('mbilling_login', 0);
3842

3943
}
4044

4145
public function getLinesCommand($command, $action = 0)
4246
{
4347
exec("sudo fail2ban-client status $command", $status);
48+
if (!isset($status[1])) {
49+
return false;
50+
}
4451

4552
foreach ($status as $value) {
4653

0 commit comments

Comments
 (0)