ucentral-client: update to latest HEAD

This adds a connection watchdog.

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2021-11-08 09:12:26 +01:00
parent 68d544c9af
commit d61d5cd35e
3 changed files with 31 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ PKG_RELEASE:=1
PKG_SOURCE_URL=https://github.com/blogic/ucentral-client.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-02-15
PKG_SOURCE_VERSION:=eabfeaa480814d5500747303f074cc6830b75200
PKG_SOURCE_VERSION:=e27356216c6baecda9424b81ad90242505e16f08
PKG_LICENSE:=BSD-3-Clause
PKG_MAINTAINER:=John Crispin <john@phrozen.org>

View File

@@ -0,0 +1,14 @@
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
PROG=/usr/libexec/ucentral-wdt.sh
start_service() {
active=$(readlink /etc/ucentral/ucentral.active)
[ -n "$active" -a "$active" != "/etc/ucentral/ucentral.cfg.0000000001" ] && return 0
procd_open_instance
procd_set_param command "$PROG"
procd_close_instance
}

View File

@@ -0,0 +1,16 @@
#!/bin/sh
sleep 60
[ -f /etc/ucentral/redirector.json ] || return 0
active=$(ubus call ucentral status | jsonfilter -e '@.active')
[ -n "$active" -a ! "$active" -eq 1 ] && {
logger ucentral-wdt: all good
exit 0
}
logger ucentral-wdt: restarting client
/etc/init.d/ucentral restart