Skip to content

Commit

Permalink
Bypass smb_verify_status with x12 pumps (#1200)
Browse files Browse the repository at this point in the history
* Fix for x12 status check

* Spacing
  • Loading branch information
cluckj authored and scottleibrand committed Feb 11, 2019
1 parent f1e8a61 commit 27f862f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/oref0-pump-loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 27f862f

Please sign in to comment.