Skip to content

Commit 3ebca32

Browse files
committed
Refactor to use is_installed helper function
1 parent 323b2d4 commit 3ebca32

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

server/lib/classes/cron.d/100-monitor_fail2ban.inc.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ public function onRunJob() {
6767
$type = 'log_fail2ban';
6868

6969
/* This monitoring is only available if fail2ban is installed */
70-
system('which fail2ban-client', $retval); // Debian, Ubuntu, Fedora
71-
if ($retval !== 0)
72-
system('which fail2ban', $retval); // CentOS
73-
if ($retval === 0) {
70+
if ($app->system->is_installed('fail2ban-client') // Debian, Ubuntu, Fedora
71+
|| $app->system->is_installed('fail2ban')) { // CentOS
7472
/* Get the data of the log */
7573
$data = $this->_tools->_getLogData($type);
7674

0 commit comments

Comments
 (0)