Fix hex string

This commit is contained in:
Bob Mottram 2017-04-15 11:30:01 +01:00
parent e103cf1122
commit 71b0bb2b63
1 changed files with 3 additions and 3 deletions

View File

@ -385,8 +385,8 @@ function firewall_remove {
function domain_to_hex_string {
domain="$1"
ctr = 1
segment=$(echo "$domain" | awk -F '.' "{print \$$ctr}")
ctr=1
segment=$(echo "$domain" | awk -F '.' -v value="$ctr" '{print $value}')
while [ ${#segment} -gt 0 ]
do
hexnum=$(echo "obase=16; $segment" | bc)
@ -396,7 +396,7 @@ function domain_to_hex_string {
echo -n "|$hexnum|$segment"
fi
ctr=$((ctr + 1))
segment=$(echo "$domain" | awk -F '.' "{print \$$ctr}")
segment=$(echo "$domain" | awk -F '.' -v value="$ctr" '{print $value}')
done
echo ""
}