diff --git a/scanners/logging-and-auditing/2.15-ensure-rsyslog-is-configured-to-send-logs-to-a-remote-log-host.sh b/scanners/logging-and-auditing/2.15-ensure-rsyslog-is-configured-to-send-logs-to-a-remote-log-host.sh index 0dcc0d1b7265b20d70c37059350b332f36079456..843470d873b4d5ac763cd80ef5b4b8b7f711180c 100644 --- a/scanners/logging-and-auditing/2.15-ensure-rsyslog-is-configured-to-send-logs-to-a-remote-log-host.sh +++ b/scanners/logging-and-auditing/2.15-ensure-rsyslog-is-configured-to-send-logs-to-a-remote-log-host.sh @@ -2,12 +2,12 @@ result_rsyslog=false result_rsyslog_d=false conf_file_path=`ls /etc/rsyslog.d/*.conf` -if [[ -a /etc/rsyslog.conf && -a $file ]]; then +if [[ -a /etc/rsyslog.conf && -a $conf_file_path ]]; then grep -q "^*.*[^I][^I]*@" /etc/rsyslog.conf && result_rsyslog=true grep -q "^*.*[^I][^I]*@" /etc/rsyslog.d/*.conf && result_rsyslog_d=true elif [[ -a /etc/rsyslog.conf ]]; then grep -q "^*.*[^I][^I]*@" /etc/rsyslog.conf && result_rsyslog=true -elif [[ -a $file ]]; then +elif [[ -a $conf_file_path ]]; then grep -q "^*.*[^I][^I]*@" /etc/rsyslog.d/*.conf && result_rsyslog_d=true fi