Merge pull request #15136 from TDT-AG/pr/2021015-openwrt-19.07-mwan3

mwan3: remove mwan3 ubus call on mwan3 iface hotplug ACTION
This commit is contained in:
Florian Eckert 2021-03-16 14:14:24 +01:00 committed by GitHub
commit 1656b49bfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View file

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

View file

@ -53,14 +53,10 @@ if [ "$ACTION" = "ifup" ]; then
fi
if [ "$initial_state" = "offline" ]; then
json_load "$(ubus call mwan3 status '{"section":"interfaces"}')"
json_select "interfaces"
json_select "${INTERFACE}"
json_get_var running running
json_get_var status status
status=$(cat $MWAN3TRACK_STATUS_DIR/$INTERFACE/STATUS 2>/dev/null || echo unknown)
[ "$status" = "online" ] || status=offline
else
status=online
running=1
fi
$LOG notice "Execute "$ACTION" event on interface $INTERFACE (${DEVICE:-unknown})"
@ -72,7 +68,7 @@ case "$ACTION" in
mwan3_create_iface_iptables $INTERFACE $DEVICE
mwan3_create_iface_rules $INTERFACE $DEVICE
mwan3_create_iface_route $INTERFACE $DEVICE
if [ "${running}" -eq 1 ] && [ "${status}" = "online" ]; then
if [ "${status}" = "online" ]; then
$LOG notice "Starting tracker on interface $INTERFACE (${DEVICE:-unknown})"
mwan3_set_iface_hotplug_state $INTERFACE "online"
mwan3_track $INTERFACE $DEVICE "online" "$src_ip"