mwan3: Remove fork/exec for head

Instead, let sed do the work since it's already being used.

Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
[ update PKG_VERSION ]
This commit is contained in:
Brian J. Murrell 2020-09-25 09:32:48 -04:00 committed by Florian Eckert
parent c5d61945fc
commit b038148cc0
2 changed files with 2 additions and 2 deletions

View file

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
PKG_VERSION:=2.8.13
PKG_VERSION:=2.8.14
PKG_RELEASE:=1
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
PKG_LICENSE:=GPL-2.0

View file

@ -140,7 +140,7 @@ main() {
# https://bugs.openwrt.org/index.php?do=details&task_id=2897
# so get the IP address of the interface and use that instead
if echo $track_ip | grep -q ':'; then
ADDR=$(ip -6 addr ls dev "$DEVICE" | sed -ne '/\/128/d' -e 's/ *inet6 \([^ \/]*\).* scope global.*/\1/p' | head -n1)
ADDR=$(ip -6 addr ls dev "$DEVICE" | sed -ne '/\/128/d' -e '1,/ *inet6 /s/ *inet6 \([^ \/]*\).* scope global.*/\1/p')
[ -z "$ADDR" ] && ADDR=$(ip -6 addr ls dev "$DEVICE" | sed -ne 's/ *inet6 \([^ \/]*\).* scope global.*/\1/p')
ping_protocol=6
fi