<div dir="ltr"><div>===Start of Linux shell script===<br>#!/bin/sh<br># Linux shell script: detect-missing-snort-rule-files.sh<br># Written by: Teo En Ming<br># Email: <a href="mailto:teo.en.ming@...11827...">teo.en.ming@...11827...</a><br>
# Date: 12 April 2014 Saturday 1:00 P.M. Singapore Time<br># Version: 1.0<br>#<br># This program detects missing rule files in your /etc/snort/snort.conf configuration file.<br>#<br><br>RULE_PATH=/etc/snort/rules<br>SNORT_CONF=/etc/snort/snort.conf<br>
<br>cd $RULE_PATH<br><br>for i in `ls -1 $RULE_PATH`<br>do<br>    grep "^include \$RULE_PATH/$i" $SNORT_CONF > /dev/null<br>    if [ $? -ne 0 ]<br>    then<br>        echo "$i not included in $SNORT_CONF!"<br>
    fi    <br>done<br></div>===End of Linux shell script===<br></div>