Commit d56a2686 authored by Franco Fichtner's avatar Franco Fichtner

netflow: improve matching, don't want prefix match

parent bab84379
......@@ -53,7 +53,7 @@ setup_interface()
fi
interface=$1
# determine (snmp) ifIndex
ifIndex=`/usr/bin/netstat -i -n | /usr/bin/grep Link# | /usr/bin/grep $interface | awk '{print $3}' | /usr/bin/sed 's/<Link#//g' | /usr/bin/sed 's/>//g'`
ifIndex=$(/usr/bin/netstat -Win | /usr/bin/grep Link# | awk '{if ( $1 == "'"$interface"'" ) {print $3 }}' | /usr/bin/sed 's/<Link#//g' | /usr/bin/sed 's/>//g')
if [ "$ifIndex" == "" ]; then
echo "error : interface $interface not found"
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment