#!/bin/bash
if [[ $# -ne 1 ]]; then
    echo "Must pass mac address"
    exit 1
fi

echo -n $1 | xxd -r -p | openssl dgst -sha1 -mac HMAC -macopt hexkey:8544E3B47ECA58F9583043F8 | awk '{print $2}' | cut -c 1-24 | sed 's/^\(.\{4\}\)\(.\{4\}\)\(.\{4\}\)\(.\{4\}\)\(.\{4\}\)\(.\{4\}\)/\1-\2-\3-\4-\5-\6/'
