This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Thanks to: https://askubuntu.com/a/852027 | |
# Takes the following string: '\000\001\000\001\037\305\371\341\001\002\003\004\005\006' (example from /var/lib/dhcp/...) | |
# and converts it to a readable DHCPv6 DUID. | |
# usage: ./duid-converter.sh '\000\001\000\001\037\305\371\341\001\002\003\004\005\006' | |
printf $1 | hexdump -e '14/1 "%02x " "\n"' | sed 's/ /:/g' |