Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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