From 27f862f8b8b64b21c381105f5b3de78363d5d0f7 Mon Sep 17 00:00:00 2001 From: Jon Cluck Date: Mon, 11 Feb 2019 16:00:12 -0500 Subject: [PATCH] Bypass smb_verify_status with x12 pumps (#1200) * Fix for x12 status check * Spacing --- bin/oref0-pump-loop.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/oref0-pump-loop.sh b/bin/oref0-pump-loop.sh index 20d108aac..a1d2fb8aa 100755 --- a/bin/oref0-pump-loop.sh +++ b/bin/oref0-pump-loop.sh @@ -365,6 +365,10 @@ function smb_verify_status { rm -rf monitor/status.json echo -n "Checking pump status (suspended/bolusing): " ( check_status || check_status ) 2>&3 >&4 \ + && if grep -q 12 monitor/status.json; then + echo -n "x12 model detected. " + return 0 + fi \ && cat monitor/status.json | colorize_json \ && grep -q '"status": "normal"' monitor/status.json \ && grep -q '"bolusing": false' monitor/status.json \ @@ -373,10 +377,6 @@ function smb_verify_status { unsuspend_if_no_temp refresh_pumphistory_and_meal false - fi \ - && if grep -q 12 monitor/status.json; then - echo -n "x12 model detected." - true fi } @@ -804,8 +804,8 @@ function check_model() { } function check_status() { set -o pipefail - if ( grep 12 settings/model.json ); then - touch monitor/status.json + if ( grep -q 12 settings/model.json ); then + echo '{ "status":"status on x12 not supported" }' > monitor/status.json else mdt status 2>&3 | tee monitor/status.json 2>&3 >&4 && cat monitor/status.json | colorize_json .status fi