Healthcheck now works

python replaced by (much smaller) jq
	closes #24
This commit is contained in:
Jan-Piet Mens
2019-01-09 19:55:32 +01:00
parent e59dd7f0dc
commit 032a6ee172
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -28,6 +28,8 @@ RUN apk add --no-cache --virtual .build-deps \
&& rm -rf /usr/local/source \
&& chmod 755 /usr/local/sbin/recorder-health.sh \
&& apk del .build-deps
RUN apk add --no-cache \
curl jq
VOLUME ["/store", "/config"]
+1 -1
View File
@@ -21,7 +21,7 @@ curl -sSL --data "${location}" "http://${addr}:${port}/pub?u=ping&d=ping" > /dev
# obtain tst of ping/ping's last location
ret_epoch=$(curl -sSL http://${addr}:${port}/api/0/last --data "user=ping&device=ping" |
env python -c 'import sys, json; print json.load(sys.stdin)[0]["tst"];')
env jq -r '.[0].tst' )
if [ $epoch -ne $ret_epoch ]; then
echo PANIC $epoch $ret_epoch