-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·20 lines (14 loc) · 1.2 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
while true; do
curl "$NIGHTSCOUT_HOST/api/v1/status.json?token=$NIGHTSCOUT_TOKEN" | aws s3 cp - "s3://$AWS_S3_BUCKET/api/v1/status.json"
aws s3api put-object-acl --bucket "$AWS_S3_BUCKET" --key api/v1/status.json --acl public-read
curl "$NIGHTSCOUT_HOST/api/v1/treatments.json?token=$NIGHTSCOUT_TOKEN" | aws s3 cp - "s3://$AWS_S3_BUCKET/api/v1/treatments.json"
aws s3api put-object-acl --bucket "$AWS_S3_BUCKET" --key api/v1/treatments.json --acl public-read
curl "$NIGHTSCOUT_HOST/api/v1/devicestatus.json?token=$NIGHTSCOUT_TOKEN" | aws s3 cp - "s3://$AWS_S3_BUCKET/api/v1/devicestatus.json"
aws s3api put-object-acl --bucket "$AWS_S3_BUCKET" --key api/v1/devicestatus.json --acl public-read
curl "$NIGHTSCOUT_HOST/api/v1/entries.json?token=$NIGHTSCOUT_TOKEN" | aws s3 cp - "s3://$AWS_S3_BUCKET/api/v1/entries.json"
aws s3api put-object-acl --bucket "$AWS_S3_BUCKET" --key api/v1/entries.json --acl public-read
curl "$NIGHTSCOUT_HOST/api/v1/entries/sgv.json?token=$NIGHTSCOUT_TOKEN&count=8640" | aws s3 cp - "s3://$AWS_S3_BUCKET/api/v1/entries/sgv.json"
aws s3api put-object-acl --bucket "$AWS_S3_BUCKET" --key api/v1/entries/sgv.json --acl public-read
sleep "${WAIT_IN_SECONDS:=60}"
done