projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
obrisane nepotrebne datoteke od zadnjeg builda
[ossec-hids.git]
/
active-response
/
route-null.sh
diff --git
a/active-response/route-null.sh
b/active-response/route-null.sh
index
5bc3e40
..
4a336ee
100755
(executable)
--- a/
active-response/route-null.sh
+++ b/
active-response/route-null.sh
@@
-29,6
+29,12
@@
if [ "x${IP}" = "x" ]; then
exit 1;
fi
exit 1;
fi
+# Match the loopback address to the version of the provided IP address
+LOOPBACK=127.0.0.1
+echo "${IP}" | grep "\:" > /dev/null 2>&1
+if [ $? = 0 ]; then
+ LOOPBACK=::1
+fi
# Adding the ip to null route
if [ "x${ACTION}" = "xadd" ]; then
# Adding the ip to null route
if [ "x${ACTION}" = "xadd" ]; then
@@
-38,7
+44,7
@@
if [ "x${ACTION}" = "xadd" ]; then
fi
if [ "X${UNAME}" = "XFreeBSD" ]; then
fi
if [ "X${UNAME}" = "XFreeBSD" ]; then
- route -q add ${IP} 127.0.0.1 -blackhole
+ route -q add ${IP} $LOOPBACK -blackhole
exit 0;
fi
exit 0;
fi
@@
-51,7
+57,7
@@
elif [ "x${ACTION}" = "xdelete" ]; then
fi
if [ "X${UNAME}" = "XFreeBSD" ]; then
fi
if [ "X${UNAME}" = "XFreeBSD" ]; then
- route -q delete ${IP} 127.0.0.1 -blackhole
+ route -q delete ${IP} $LOOPBACK -blackhole
exit 0;
fi
exit 0;
fi