package/gluon-core: ignore double quoting in mac addr split

This commit is contained in:
Jan-Tarek Butt 2019-12-08 23:39:54 +01:00
parent 6dbabad49f
commit e2d271b480

View File

@ -14,9 +14,10 @@ xor2() {
echo -n "${1:1:1}" | tr '0123456789abcdef' '23016745ab89efcd'
}
# shellcheck disable=SC2086
interface_linklocal() {
local macaddr="$(ubus call network.device status '{"name": "'"$1"'"}' | jsonfilter -e '@.macaddr')"
local oldIFS="$IFS"; IFS=':'; set -- "$macaddr"; IFS="$oldIFS"
local oldIFS="$IFS"; IFS=':'; set -- $macaddr; IFS="$oldIFS"
echo "fe80::$(xor2 "$1")$2:$3ff:fe$4:$5$6"
}