mwan3: remove mwan3 ubus call on mwan3 iface hotplug ACTION
With this change, the interface status is no longer read from the mwan3 ubus.
The status of the interface is read directly from the status directory.
This was already implemented in the master with the
commit c07f5230be
.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
e573dac5f1
commit
40d56e46b1
2 changed files with 4 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue