Browse Source

Merge pull request #8015 from TDT-AG/pr/20190122-mwan3

mwan3: update version
lilik-openwrt-22.03
Hannu Nyman 6 years ago
committed by GitHub
parent
commit
ce69b6979e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 8 deletions
  1. +1
    -1
      net/mwan3/Makefile
  2. +4
    -4
      net/mwan3/files/etc/hotplug.d/iface/15-mwan3
  3. +2
    -2
      net/mwan3/files/etc/hotplug.d/iface/16-mwan3
  4. +2
    -0
      net/mwan3/files/lib/mwan3/mwan3.sh
  5. +4
    -0
      net/mwan3/files/usr/sbin/mwan3
  6. +6
    -1
      net/mwan3/files/usr/sbin/mwan3rtmon

+ 1
- 1
net/mwan3/Makefile View File

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


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

@ -16,11 +16,11 @@ config_load mwan3
config_get_bool enabled globals 'enabled' '0'
[ ${enabled} -gt 0 ] || exit 0
mwan3_lock
mwan3_lock "$ACTION" "$INTERFACE"
mwan3_init
mwan3_set_connected_iptables
mwan3_set_custom_ipset
mwan3_unlock
mwan3_unlock "$ACTION" "$INTERFACE"
config_get enabled $INTERFACE enabled 0
config_get initial_state $INTERFACE initial_state "online"
@ -58,7 +58,7 @@ else
running=1
fi
mwan3_lock
mwan3_lock "$ACTION" "$INTERFACE"
$LOG notice "Execute "$ACTION" event on interface $INTERFACE (${DEVICE:-unknown})"
case "$ACTION" in
@ -91,6 +91,6 @@ case "$ACTION" in
;;
esac
mwan3_unlock
mwan3_unlock "$ACTION" "$INTERFACE"
exit 0

+ 2
- 2
net/mwan3/files/etc/hotplug.d/iface/16-mwan3 View File

@ -9,9 +9,9 @@ config_get_bool enabled globals 'enabled' '0'
[ ${enabled} -gt 0 ] || exit 0
if [ "$ACTION" == "ifup" ]; then
mwan3_lock
mwan3_lock "$ACTION" "mwan3rtmon"
mwan3_rtmon
mwan3_unlock
mwan3_unlock "$ACTION" "mwan3rtmon"
fi
exit 0

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

@ -163,9 +163,11 @@ mwan3_init()
mwan3_lock() {
lock /var/run/mwan3.lock
# $LOG debug "$1 $2 (lock)"
}
mwan3_unlock() {
# $LOG debug "$1 $2 (unlock)"
lock -u /var/run/mwan3.lock
}


+ 4
- 0
net/mwan3/files/usr/sbin/mwan3 View File

@ -136,6 +136,8 @@ stop()
{
local ipset route rule table IP IPT pid
mwan3_lock "command" "mwan3"
for pid in $(pgrep -f "mwan3rtmon"); do
kill -TERM "$pid" > /dev/null 2>&1
sleep 1
@ -184,6 +186,8 @@ stop()
$IPS -q destroy $ipset
done
mwan3_unlock "command" "mwan3"
mwan3_lock_clean
rm -rf $MWAN3_STATUS_DIR $MWAN3TRACK_STATUS_DIR


+ 6
- 1
net/mwan3/files/usr/sbin/mwan3rtmon View File

@ -23,11 +23,16 @@ main() {
config_get rtmon_interval globals rtmon_interval '5'
sleep 3
while mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6; do
while true; do
mwan3_lock "service" "mwan3rtmon"
[ mwan3_remon_ipv4 = "1" ] || \
[ mwan3_rtmon_ipv6 = "1" ] && break
mwan3_unlock "service" "mwan3rtmon"
[ "$rtmon_interval" = "0" ] && break
sleep "$rtmon_interval" &
wait
done
mwan3_unlock "service" "mwan3rtmon"
}
main "$@"

Loading…
Cancel
Save