diff --git a/back/update_vendors.sh b/back/update_vendors.sh index fa03d101..0e2fc953 100755 --- a/back/update_vendors.sh +++ b/back/update_vendors.sh @@ -30,13 +30,12 @@ IEEE_OUI_URL="http://standards-oui.ieee.org/oui/oui.txt" # Download the file using wget wget "$IEEE_OUI_URL" -O ieee-oui_dl.txt -# Filter lines containing "(base 16)" and remove the "(base 16)" string -grep "(base 16)" ieee-oui_dl.txt | sed 's/ *(base 16)//' > ieee-oui_new.txt - -# Combine ieee-oui_new.txt and ieee-oui.txt, and extract unique MAC start values along with vendor names +# Filter lines containing "(base 16)" and format them with a tab between MAC and vendor +grep "(base 16)" ieee-oui_dl.txt | sed -E 's/ *\(base 16\)//' | awk -F' ' '{printf "%s\t%s\n", $1, substr($0, index($0, $2))}' > ieee-oui_new.txt +# Combine, sort, and remove duplicates, ensuring tab-separated output cat ieee-oui.txt ieee-oui_new.txt >> ieee-oui_all.txt -sort ieee-oui_all.txt > ieee-oui_all_sort.txt -awk '{$1=$1; print}' ieee-oui_all_sort.txt | sort -u > ieee-oui_all_filtered.txt +sort ieee-oui_all.txt | awk '{$1=$1; print}' | sort -u | awk -F' ' '{printf "%s\t%s\n", $1, substr($0, index($0, $2))}' > ieee-oui_all_filtered.txt + diff --git a/server/device.py b/server/device.py index e2757f8f..af876119 100755 --- a/server/device.py +++ b/server/device.py @@ -634,7 +634,7 @@ def query_MAC_vendor (pMAC): for line in f: line_lower = line.lower() # Convert line to lowercase for case-insensitive matching if line_lower.startswith(mac_start_string6): - parts = line.split(' ', 1) + parts = line.split('\t', 1) if len(parts) > 1: vendor = parts[1].strip() mylog('debug', [f"[Vendor Check] Found '{vendor}' for '{pMAC}' in {vendorsPath}"])