Fix hex string

This commit is contained in:
Bob Mottram 2017-04-20 10:46:40 +01:00
parent c218eaa7a4
commit 71cb693fad
1 changed files with 2 additions and 1 deletions

View File

@ -389,7 +389,8 @@ function domain_to_hex_string {
segment=$(echo "$domain" | awk -F '.' -v value="$ctr" '{print $value}')
while [ ${#segment} -gt 0 ]
do
hexnum=$(echo "obase=16; $segment" | bc)
characters=$(echo -n "$segment" | wc -c)
hexnum=$(echo "obase=16; $characters" | bc)
if [ ${hexnum} -lt 2 ]; then
echo -n "|0${hexnum}|$segment"
else