mwan3: use procd for mwan3rtmon and mwan3track

start all mwan3mon and mwan3track instances on mwan3 start
if an interface is down when mwan3track starts, it waits
for a signal from the hotplug script to start

procd can then handle stopping all of the scripts when mwan3
is halted

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
This commit is contained in:
Aaron Goodman
2020-08-12 20:38:56 -04:00
parent 5faa99f3b8
commit 566293d228
9 changed files with 465 additions and 325 deletions

View File

@@ -77,16 +77,13 @@ get_mwan3_status() {
local online=0
local offline=0
local up="0"
local enabled pid device time_p time_n time_u time_d status
local enabled device time_p time_n time_u time_d status track_status
network_get_device device $1
if [ "${iface}" = "${iface_select}" ] || [ "${iface_select}" = "" ]; then
pid="$(pgrep -f "mwan3track $iface $device")"
if [ "${pid}" != "" ]; then
running="1"
fi
track_status="$(mwan3_get_mwan3track_status "$1")"
[ "$track_status" = "active" ] && running="1"
time_p="$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/TIME")"
[ -z "${time_p}" ] || {
time_n="$(get_uptime)"