From 93a87625a7f0ed28a8f974c1646d7ce676a37c1a Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 12 Jul 2012 07:08:09 +0000 Subject: Do not restart/start snort after rule update if its not running --- config/snort/snort_check_for_rule_updates.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/snort/snort_check_for_rule_updates.php b/config/snort/snort_check_for_rule_updates.php index 153278eb..3871b813 100644 --- a/config/snort/snort_check_for_rule_updates.php +++ b/config/snort/snort_check_for_rule_updates.php @@ -399,9 +399,12 @@ if ($snortdownload == 'on' || $emergingthreats == 'on') { } } - exec("/bin/sh /usr/local/etc/rc.d/snort.sh restart"); - update_output_window(gettext("Snort has restarted with your new set of rules...")); - log_error(gettext("Snort has restarted with your new set of rules...")); + if (is_process_running("snort")) { + exec("/bin/sh /usr/local/etc/rc.d/snort.sh restart"); + update_output_window(gettext("Snort has restarted with your new set of rules...")); + log_error(gettext("Snort has restarted with your new set of rules...")); + } else + log_error(gettext("Snort Rules update finished...")); } update_status(gettext("The Rules update finished...")); -- cgit v1.2.3