#!/bin/sh # $Id$ # PROVIDE: snort # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: FreeBSD shutdown # Add the following lines to /etc/rc.conf to enable snort: # snort_enable (bool): Set to YES to enable snort # Default: NO # snort_flags (str): Extra flags passed to snort # Default: -Dq # snort_interface (str): Network interface to sniff # Default: "" # snort_conf (str): Snort configuration file # Default: ${PREFIX}/etc/snort.conf # # Multiple interfaces # snort_enable_fxp0="YES" # snort_conf_fxp0="/usr/local/etc/snort_fxp0.conf" # snort_interface_fxp0="fxp0" # snort_enable_fxp1="YES" # snort_conf_fxp1="/usr/local/etc/snort_fxp1.conf" # snort_interface_fxp1="fxp1" . /etc/rc.subr name="snort" rcvar=`set_rcvar` command="/usr/local/bin/snort" load_rc_config $name [ -z "$snort_enable_fxp0" ] && snort_enable="NO" [ -z "$snort_conf_fxp0" ] && snort_conf="/usr/local/etc/snort_fxp0.conf" [ -z "$snort_flags" ] && snort_flags="-DRq" [ -n "$snort_interface_fxp0" ] && snort_flags="$snort_flags -i $snort_interface_fxp0" [ -n "$snort_conf_fxp0" ] && snort_flags="$snort_flags -c $snort_conf_fxp0" [ -z "$snort_enable_fxp1" ] && snort_enable="NO" [ -z "$snort_conf_fxp1" ] && snort_conf="/usr/local/etc/snort_fxp1.conf" [ -z "$snort_flags" ] && snort_flags="-DRq" [ -n "$snort_interface_fxp1" ] && snort_flags="$snort_flags -i $snort_interface_fxp1" [ -n "$snort_conf_fxp1" ] && snort_flags="$snort_flags -c $snort_conf_fxp1" run_rc_command "$1"