]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/blobdiff - src/initscripts/init.d/snort
snort: Also monitor assigned alias addresses on red.
[people/mfischer/ipfire-2.x.git] / src / initscripts / init.d / snort
index e03c80fea90461dcde0a47379b744e64deaaa4bd..58edf1e6db66a5d79d52ab3b449356474ee97da0 100644 (file)
@@ -20,6 +20,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin; export PATH
 eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
 eval $(/usr/local/bin/readhash /var/ipfire/snort/settings)
 
+ALIASFILE="/var/ipfire/ethernet/aliases"
+
 case "$1" in
         start)
                if [ "$BLUE_NETADDRESS" ]; then
@@ -59,6 +61,19 @@ case "$1" in
                        if [ "$LOCAL_IP" ]; then
                                HOMENET+="$LOCAL_IP,"
                        fi
+
+                       # Check if the red device is set to static and
+                       # any aliases have been configured.
+                       if [ "${RED_TYPE}" == "STATIC" ] && [ -s "${ALIASFILE}" ]; then
+                               # Read in aliases file.
+                               while IFS="," read -r address mode remark; do
+                                       # Check if the alias is enabled.
+                                       [ "${mode}" = "on" ] || continue
+
+                                       # Add alias to the list of HOMENET addresses.
+                                       HOMENET+="${address},"
+                               done < "${ALIASFILE}"
+                       fi
                fi
                HOMENET+="127.0.0.1"
                echo "ipvar HOME_NET [$HOMENET]" > /etc/snort/vars