iptohex (convert an ipaddress into hexadecimal)

Script: iptohex

No error checking, just a simple time saver. Converts an ipaddress into hexadecimal suitable for use by tftp tools and pxe booting. The builtin command gethostip does this also, I include the script incase someone finds it useful.

Example:

uphill@surrey[1]: 
iptohex 10.168.192.134 0AA8C086

#!/bin/bash
 
IPADDR=$1
 
if [ x${IPADDR}x = xx ]; then
	echo "usage: $0 <ipaddress>"
	exit 1
fi
 
for octet in `echo $IPADDR |tr '.' ' '`
do
	printf "%02X" "$octet"
 
done
echo

About the Author...

Slides from LISA 2019 Linux systems troubleshooting #LISA2019 https://t.co/D4dMKflK6R Tue Oct 29 05:59:30 +0000 2019

https://t.co/AGeihMALAv configuring grub2 with EFI Fri Sep 13 05:20:01 +0000 2019

I published a Thing on @thingiverse! https://t.co/IYpRyEb7Hz #thingalert Tue Jul 23 19:27:57 +0000 2019

Nokogiri install on MacOSX https://t.co/v3An0miW9L Fri Jul 12 15:06:49 +0000 2019

HTML email with plain mailer plugin on Jenkins https://t.co/Z6FSDMDjy8 Thu Jul 11 21:07:25 +0000 2019