Skip to content
Snippets Groups Projects
Commit 61ef4a3c authored by Bob Mottram's avatar Bob Mottram
Browse files

Use hex numbers

parent 1ada2d7a
No related branches found
No related tags found
No related merge requests found
......@@ -346,10 +346,11 @@ function domain_to_hex_string {
segment=$(echo "$domain" | awk -F '.' "{print \$$ctr}")
while [ ${#segment} -gt 0 ]
do
if [ ${#segment} -lt 10 ]; then
echo -n "|0${#segment}|$segment"
hexnum=$(echo "obase=16; $segment" | bc)
if [ ${hexnum} -lt 2 ]; then
echo -n "|0${hexnum}|$segment"
else
echo -n "|${#segment}|$segment"
echo -n "|$hexnum|$segment"
fi
ctr=$((ctr + 1))
segment=$(echo "$domain" | awk -F '.' "{print \$$ctr}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment