Browse Source

Merge pull request #4503 from TDT-GmbH/mwan3_changes

net/mwan3: add lock
lilik-openwrt-22.03
Hannu Nyman 8 years ago
committed by GitHub
parent
commit
96f67e6fc3
3 changed files with 13 additions and 2 deletions
  1. +1
    -1
      net/mwan3/Makefile
  2. +3
    -0
      net/mwan3/files/etc/hotplug.d/iface/15-mwan3
  3. +9
    -1
      net/mwan3/files/lib/mwan3/mwan3.sh

+ 1
- 1
net/mwan3/Makefile View File

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


+ 3
- 0
net/mwan3/files/etc/hotplug.d/iface/15-mwan3 View File

@ -38,6 +38,7 @@ if [ "$ACTION" == "ifup" ]; then
[ -n "$gateway" ] || exit 9
fi
mwan3_lock
$LOG notice "$ACTION interface $INTERFACE (${DEVICE:-unknown})"
case "$ACTION" in
@ -64,4 +65,6 @@ case "$ACTION" in
;;
esac
mwan3_unlock
exit 0

+ 9
- 1
net/mwan3/files/lib/mwan3/mwan3.sh View File

@ -8,6 +8,14 @@ IPT6="ip6tables -t mangle -w"
LOG="logger -t mwan3 -p"
CONNTRACK_FILE="/proc/net/nf_conntrack"
mwan3_lock() {
lock /var/run/mwan3.lock
}
mwan3_unlock() {
lock -u /var/run/mwan3.lock
}
mwan3_get_iface_id()
{
local _tmp _iface _iface_count
@ -730,7 +738,7 @@ mwan3_report_iface_status()
config_list_foreach $1 track_ip mwan3_list_track_ips
if [ -n "$track_ips" ]; then
if [ -n "$(ps -w | grep mwan3track | grep -v grep | sed '/.*\/usr\/sbin\/mwan3track \([^ ]*\) .*$/!d;s//\1/' | awk '$1 == "'$1'"')" ]; then
if [ -n "$(pgrep -f "mwan3track $1")" ]; then
tracking="active"
else
tracking="down"


Loading…
Cancel
Save