#!/bin/sh -e

##########################################################################
#   Script description:
#       Convert a hex value to networking octet
#       
#   History:
#   Date        Name        Modification
#   2020-02-04  Jason Bacon Begin
##########################################################################

usage()
{
    printf "Usage: $0 0x########\n"
    exit 1
}


##########################################################################
#   Main
##########################################################################

if [ $# != 1 ]; then
    usage
fi

hex=$1
printf "%u.%u.%u.%u\n" $(( $hex >> 24 )) $(( ($hex >> 16) & 0xff )) \
		       $(( ($hex >> 8) & 0xff )) $(( $hex & 0xff ))
