The below script can be used to find any vendor by Mac: Raspberry Pi or otherwise.
Just supply the vendor's name as it's specified in the IEEE's MAC DB:
"http://standards-oui.ieee.org/oui.txt"
in the variable "VENDOR" and of course replace the echo's in the conditional expression with something useful.
In its' present form it's meant to execute locally on a host, but the script could be adapted quite easily I imagine.
#!/bin/bash
#set -x
VENDOR='Raspberry Pi'
OUI=`ip addr list | grep -w link | awk '{print $2}' | grep -P "^(?!00:00:00)"| grep -P "^(?!fe80)" | tr -d ":" | head -c 6`
if [[ $( curl -sS "http://standards-oui.ieee.org/oui.txt" | grep -i "$OUI" | grep -o "$VENDOR" ) = 'Raspberry Pi' ]]; then
echo "This is a Pi"
else
echo "This is NOT a Pi"
fi
It is worth noticing, that the companyname (in the oui.txt) changed with the new Pi4:
B8-27-EB
(hex) Raspberry Pi Foundation
DC-A6-32
(hex) Raspberry Pi Trading Ltd.