-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete Future Data for better recovery of Time on System during No network power on for edison #413
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab1fee9
Merge pull request #1 from openaps/dev
Bender1061 86d9927
Create oref0-delete-future-entries.sh
Bender1061 2d76193
Update package.json
Bender1061 5c58602
Update oref0-setup.sh
Bender1061 08d6ecf
Update oref0-setup.sh
Bender1061 183d192
Alphabetize
scottleibrand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Since the Edison does not have an internal clock | ||
# after a reboot if you do not have the correct time your date will be older than | ||
# the time on the CGM data in the monitor folder. | ||
# Currently all the checks for time in the system is looking at data being older than current | ||
# time | ||
# This will delete all the data in the | ||
# monitor directory. Allowing oref0 to gather all of the data again in pump-loop | ||
|
||
NEWTIME=$(date -d `(jq .[1].display_time monitor/glucose.json; echo ) | sed 's/"//g'` +%s) | ||
TIME=$(date --date '5 minutes' +%s) | ||
|
||
echo $NEWTIME | ||
echo $TIME | ||
|
||
if [ $NEWTIME -gt $TIME ]; then | ||
echo CGM Time is newer than Edison Time$'\n'Deleting All Monitor Files | ||
sudo rm -rf monitor/* | ||
elif [ $NEWTIME -lt $TIME ]; then | ||
echo "No Newer CGM Data found" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we need to install jq by default before this will work for everyone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll go make that PR in docs