You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
494 B

#!/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() {
local rtmon_interval
trap clean_up TERM
trap rtchange USR1
config_load mwan3
config_get rtmon_interval globals rtmon_interval '5'
sleep 3
while mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6; do
[ "$rtmon_interval" = "0" ] && break
sleep $rtmon_interval
done
}
main "$@"