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

Fix hex string

parent e103cf11
No related branches found
No related tags found
No related merge requests found
......@@ -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 ""
}
......
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