]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/snort
7dd334cdab17422e58e80659e0a572b70ca4b4f9
2 ########################################################################
3 # Begin $rc_base/init.d/snort
5 # Description : Snort Initscript
7 # Authors : Michael Tremer for ipfire.org - mitch@ipfire.org
13 ########################################################################
18 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
19 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/snort
/settings
)
21 if [ "$ENABLE_SNORT_ORANGE" == "on" ]; then
22 HOME_NET
+="$ORANGE_ADDRESS,"
23 DEVICES
+="$ORANGE_DEV "
26 if [ "$ENABLE_SNORT_GREEN" == "on" ]; then
27 HOME_NET
+="$GREEN_ADDRESS,"
28 DEVICES
+="$GREEN_DEV "
31 if [ "$ENABLE_SNORT_BLUE" == "on" ]; then
32 HOME_NET
+="$BLUE_ADDRESS,"
36 if [ "$ENABLE_SNORT" == "on" ]; then
37 LOCAL_IP
=`cat /var/ipfire/red/local-ipaddress`
38 if [ "$LOCAL_IP" ]; then
39 HOME_NET
+="$LOCAL_IP,"
41 exit 1 ## Add error handling here
43 DEVICES
+="`cat /var/ipfire/red/iface` "
46 COUNT
=`echo $HOME_NET | wc -m`
47 HOME_NET
=`echo $HOME_NET | cut -c $[$COUNT - 2]`
49 echo "var HOME_NET [$HOME_NET]" > /etc
/snort
/vars
50 echo "var EXTERNAL_NET ANY" >> /etc
/snort
/vars
52 DNS1
=`cat /var/ipfire/red/dns1`
53 DNS2
=`cat /var/ipfire/red/dns2`
56 echo "var DNS_SERVERS [$DNS1,$DNS2]" >> /etc
/snort
/vars
58 echo "car DNS_SERVERS $DNS1" >> /etc
/snort
/vars
63 for DEVICE
in $DEVICES; do
64 boot_mesg
"Starting Intrusion Detection System on $DEVICE..."
65 loadproc
/usr
/sbin
/snort
-c snort.conf
-i $DEVICE -D -l /var
/log
/snort
--pid-path /var
/run
/snort_
$DEVICE.pid
69 for DEVICE
in $DEVICES; do
70 boot_mesg
"Stopping Intrusion Detection System on $DEVICE..."
71 killproc
-p /var
/run
/snort_
$DEVICE.pid
/var
/run
75 statusproc
/usr
/sbin
/snort
83 echo "Usage: $0 {start|stop|restart|status|update}"
88 # End $rc_base/init.d/snort