Browse Source

Merge pull request #5164 from TDT-AG/pr/20171116-net-mwan3-fixes

net/mwan3: add improvments and add a fix
lilik-openwrt-22.03
champtar 7 years ago
committed by GitHub
parent
commit
7031f4cdbd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 4 deletions
  1. +1
    -1
      net/mwan3/Makefile
  2. +1
    -1
      net/mwan3/files/etc/hotplug.d/iface/14-mwan3
  3. +6
    -0
      net/mwan3/files/lib/mwan3/common.sh
  4. +2
    -1
      net/mwan3/files/usr/libexec/rpcd/mwan3
  5. +2
    -1
      net/mwan3/files/usr/sbin/mwan3track

+ 1
- 1
net/mwan3/Makefile View File

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


+ 1
- 1
net/mwan3/files/etc/hotplug.d/iface/14-mwan3 View File

@ -28,7 +28,7 @@ src_ip=$(uci_get_state mwan3 globals src_ip)
ip addr del "${src_ip}/32" dev lo 1>/dev/null 2>&1
}
usleep 10000
sleep 1
[ "$ACTION" = "ifup" ] && {
network_get_ipaddr src_ip "${local_source}"


+ 6
- 0
net/mwan3/files/lib/mwan3/common.sh View File

@ -0,0 +1,6 @@
#!/bin/sh
get_uptime() {
local uptime=$(cat /proc/uptime)
echo "${uptime%%.*}"
}

+ 2
- 1
net/mwan3/files/usr/libexec/rpcd/mwan3 View File

@ -3,6 +3,7 @@
. /lib/functions.sh
. /lib/functions/network.sh
. /usr/share/libubox/jshn.sh
. /lib/mwan3/common.sh
MWAN3TRACK_STATUS_DIR="/var/run/mwan3track"
@ -47,7 +48,7 @@ get_mwan3_status() {
time_p="$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/TIME")"
[ -z "${time_p}" ] || {
time_n="$(date +'%s')"
time_n="$(get_uptime)"
let age=time_n-time_p
}


+ 2
- 1
net/mwan3/files/usr/sbin/mwan3track View File

@ -1,6 +1,7 @@
#!/bin/sh
. /lib/functions.sh
. /lib/mwan3/common.sh
LOG="logger -t $(basename "$0")[$$] -p"
INTERFACE=""
@ -171,7 +172,7 @@ main() {
echo "${lost}" > /var/run/mwan3track/$1/LOST
echo "${score}" > /var/run/mwan3track/$1/SCORE
echo "${turn}" > /var/run/mwan3track/$1/TURN
echo "$(date +'%s')" > /var/run/mwan3track/$1/TIME
echo "$(get_uptime)" > /var/run/mwan3track/$1/TIME
host_up_count=0
sleep "${sleep_time}" &


Loading…
Cancel
Save