aboutsummaryrefslogtreecommitdiff
path: root/contrib/mac/updateoui
blob: 2a6a07c3dfbe1f8d81ce337880ddac190d3ebc27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /bin/sh
# Utility to create manufacturer's OUI table

args=
refresh=0

while [ $# -gt 0 ]
do
    case "$1" in
    --refresh|--fetch|-r)
        refresh=1
        ;;
    --norefresh|--nofetch)
        refresh=0
        ;;
    --help)
        echo "Usage: $0 --[no]refresh dbname"
        exit
        ;;
    *)
        args="$args $1"
        ;;
    esac
    shift
done

if [ $refresh -gt 0 ]; then
    [ -e oui.txt ] && rm -rf oui.txt
    wget -nd 'http://standards.ieee.org/regauth/oui/oui.txt'
fi

awk -f ouiparse.awk < oui.txt | psql -e $args

exit