Change field from digit to string for printf

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2018-11-08 11:10:09 -08:00
parent bbb759c684
commit 057fbfc2b9
No known key found for this signature in database
GPG key ID: B4FF14C01CC08DC0

View file

@ -617,7 +617,7 @@ chooseInterface() {
# See https://github.com/pi-hole/pi-hole/issues/1473#issuecomment-301745953 # See https://github.com/pi-hole/pi-hole/issues/1473#issuecomment-301745953
testIPv6() { testIPv6() {
# first will contain fda2 (ULA) # first will contain fda2 (ULA)
printf -v first "%d" "${1%%:*}" printf -v first "%s" "${1%%:*}"
# value1 will contain 253 which is the decimal value corresponding to 0xfd # value1 will contain 253 which is the decimal value corresponding to 0xfd
value1=$(( (0x$first)/256 )) value1=$(( (0x$first)/256 ))
# will contain 162 which is the decimal value corresponding to 0xa2 # will contain 162 which is the decimal value corresponding to 0xa2