Browse Source

mwan3: mwan3rtmon sleep time configurable

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
lilik-openwrt-22.03
Chen Minqiang 6 years ago
parent
commit
7817aced2b
2 changed files with 7 additions and 1 deletions
  1. +1
    -0
      net/mwan3/files/etc/config/mwan3
  2. +6
    -1
      net/mwan3/files/usr/sbin/mwan3rtmon

+ 1
- 0
net/mwan3/files/etc/config/mwan3 View File

@ -2,6 +2,7 @@
config globals 'globals' config globals 'globals'
option mmx_mask '0x3F00' option mmx_mask '0x3F00'
option local_source 'none' option local_source 'none'
option rtmon_interval '5'
config interface 'wan' config interface 'wan'
option enabled '1' option enabled '1'


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

@ -15,12 +15,17 @@ rtchange() {
} }
main() { main() {
local rtmon_interval
trap clean_up TERM trap clean_up TERM
trap rtchange USR1 trap rtchange USR1
config_load mwan3
config_get rtmon_interval globals rtmon_interval '5'
sleep 3 sleep 3
while mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6; do while mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6; do
sleep 5
[ "$rtmon_interval" = "0" ] && break
sleep $rtmon_interval
done done
} }


Loading…
Cancel
Save