mwan3: refine link selection

- globals src_ip to none
 - ip route back to source
 - add mwan3rtmon
 - update version to 2.7

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
This commit is contained in:
Chen Minqiang
2018-04-15 19:55:25 +08:00
parent 8727443f61
commit 46ed09408e
6 changed files with 142 additions and 57 deletions
+6
View File
@@ -155,6 +155,12 @@ stop()
{
local ipset route rule table IP IPT pid src_ip
for pid in $(pgrep -f "mwan3rtmon"); do
kill -TERM "$pid" > /dev/null 2>&1
sleep 1
kill -KILL "$pid" > /dev/null 2>&1
done
for pid in $(pgrep -f "mwan3track"); do
kill -TERM "$pid" > /dev/null 2>&1
sleep 1
+27
View File
@@ -0,0 +1,27 @@
#!/bin/sh
. /lib/functions.sh
. /lib/mwan3/mwan3.sh
LOG="logger -t $(basename "$0")[$$] -p"
clean_up() {
$LOG notice "Stopping mwan3rtmon..."
exit 0
}
rtchange() {
$LOG info "Detect rtchange event."
}
main() {
trap clean_up TERM
trap rtchange USR1
sleep 3
while mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6; do
sleep 5
done
}
main "$@"