From 71cb693fad9ae575d7547e67b80327d6676d510d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 20 Apr 2017 10:46:40 +0100 Subject: [PATCH] Fix hex string --- src/freedombone-utils-firewall | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/freedombone-utils-firewall b/src/freedombone-utils-firewall index 54f96688..65b7a23b 100755 --- a/src/freedombone-utils-firewall +++ b/src/freedombone-utils-firewall @@ -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