Fix hex string
This commit is contained in:
parent
e103cf1122
commit
71b0bb2b63
|
@ -386,7 +386,7 @@ function firewall_remove {
|
||||||
function domain_to_hex_string {
|
function domain_to_hex_string {
|
||||||
domain="$1"
|
domain="$1"
|
||||||
ctr=1
|
ctr=1
|
||||||
segment=$(echo "$domain" | awk -F '.' "{print \$$ctr}")
|
segment=$(echo "$domain" | awk -F '.' -v value="$ctr" '{print $value}')
|
||||||
while [ ${#segment} -gt 0 ]
|
while [ ${#segment} -gt 0 ]
|
||||||
do
|
do
|
||||||
hexnum=$(echo "obase=16; $segment" | bc)
|
hexnum=$(echo "obase=16; $segment" | bc)
|
||||||
|
@ -396,7 +396,7 @@ function domain_to_hex_string {
|
||||||
echo -n "|$hexnum|$segment"
|
echo -n "|$hexnum|$segment"
|
||||||
fi
|
fi
|
||||||
ctr=$((ctr + 1))
|
ctr=$((ctr + 1))
|
||||||
segment=$(echo "$domain" | awk -F '.' "{print \$$ctr}")
|
segment=$(echo "$domain" | awk -F '.' -v value="$ctr" '{print $value}')
|
||||||
done
|
done
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue