mirror of
https://github.com/openwrt/packages.git
synced 2026-01-10 11:44:48 +00:00
net/mwan3: use uptime for ubus age info
If the date is changed by ntp the age value of mwan3 on ubus could jitter. Use instead the uptime value from /proc/uptime which will not change during system run. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/mwan3/common.sh
|
||||
|
||||
LOG="logger -t $(basename "$0")[$$] -p"
|
||||
INTERFACE=""
|
||||
@@ -171,7 +172,7 @@ main() {
|
||||
echo "${lost}" > /var/run/mwan3track/$1/LOST
|
||||
echo "${score}" > /var/run/mwan3track/$1/SCORE
|
||||
echo "${turn}" > /var/run/mwan3track/$1/TURN
|
||||
echo "$(date +'%s')" > /var/run/mwan3track/$1/TIME
|
||||
echo "$(get_uptime)" > /var/run/mwan3track/$1/TIME
|
||||
|
||||
host_up_count=0
|
||||
sleep "${sleep_time}" &
|
||||
|
||||
Reference in New Issue
Block a user