From 03a40c77d7bd985c2abf9754bbd85f2cc47a765b Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Mon, 30 Apr 2018 17:47:27 +0200
Subject: [PATCH] #5008 Remove rkhunter update function

---
 server/lib/classes/cron.d/100-monitor_rkhunter.inc.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/server/lib/classes/cron.d/100-monitor_rkhunter.inc.php b/server/lib/classes/cron.d/100-monitor_rkhunter.inc.php
index d5beee70bc..43071b8387 100644
--- a/server/lib/classes/cron.d/100-monitor_rkhunter.inc.php
+++ b/server/lib/classes/cron.d/100-monitor_rkhunter.inc.php
@@ -72,7 +72,13 @@ class cronjob_monitor_rkhunter extends cronjob {
 			/*
 			 * Fetch the output
 			 */
-			$data['output'] = shell_exec('rkhunter --update --checkall --nocolors --skip-keypress');
+			
+			// Do not try to update rkhunter on Debian and Ubuntu, rkhunter is keept up to date with apt.
+			if(file_exists('/etc/debian_version')) {
+				$data['output'] = shell_exec('rkhunter --checkall --nocolors --skip-keypress');
+			} else {
+				$data['output'] = shell_exec('rkhunter --update --checkall --nocolors --skip-keypress');
+			}
 
 			/*
 			 * At this moment, there is no state (maybe later)
-- 
GitLab