r8 - in trunk: . mac-lookup
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Dec 14 18:32:01 CET 2006
Author: thomas
Date: 2006-12-14 18:32:00 +0100 (Thu, 14 Dec 2006)
New Revision: 8
Added:
trunk/mac-lookup/
trunk/mac-lookup/mac-lookup
Log:
imported mac-lookup script
Added: trunk/mac-lookup/mac-lookup
===================================================================
--- trunk/mac-lookup/mac-lookup 2006-12-14 16:55:22 UTC (rev 7)
+++ trunk/mac-lookup/mac-lookup 2006-12-14 17:32:00 UTC (rev 8)
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Copyright (C) 2006 by Intevation GmbH
+# Author(s):
+# Thomas Arendsen Hein <thomas at intevation.de>
+#
+# This program is free software under the GNU GPL (>=v2)
+# Read the file COPYING coming with the software for details.
+
+PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+OUI_LIST="$HOME/.mac-lookup.txt"
+
+usage() {
+ echo "Translate MAC (ethernet) address to vendor." >&2
+ echo "`basename $0`: usage: `basename $0` aa:bb:cc ..." >&2
+ exit 1
+}
+
+test $# -eq 0 && usage
+
+if [ ! -f "$OUI_LIST" ]; then
+ curl -o "$OUI_LIST" http://anonsvn.ethereal.com/ethereal/trunk/manuf
+fi
+
+
+while [ $# -ge 1 ]; do
+ SEARCH=`echo "$1"|tr -- '-' ':'|egrep -i '^[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f](:[0-9a-f][0-9a-f])*$'|cut -d: -f1-3`
+ test -z "$SEARCH" && usage
+ echo "Searching for OUI '$SEARCH':"
+ grep -i -- "^$SEARCH" "$OUI_LIST" || echo "not found."
+ shift
+done
Property changes on: trunk/mac-lookup/mac-lookup
___________________________________________________________________
Name: svn:executable
+ *
More information about the Adminton-commits
mailing list