packages/net/mwan3/files/lib/mwan3/common.sh
Florian Eckert 267c0eeaed 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>
2017-11-16 09:15:04 +01:00

6 lines
84 B
Bash

#!/bin/sh
get_uptime() {
local uptime=$(cat /proc/uptime)
echo "${uptime%%.*}"
}