Skip to content

Commit 8553277

Browse files
committed
2 parents ed76ea3 + 480edb0 commit 8553277

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/Monitor/eg001GetMonitoringData.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@ declare -a Headers=('--header' "Authorization: Bearer ${ACCESS_TOKEN}"
1616
# the monitoring records
1717

1818
#ds-snippet-start:Monitor1Step3
19+
if date -v -10d &>/dev/null; then
20+
# Mac
21+
cursorDate=$(date -v -1y '+%Y-%m-%d')
22+
else
23+
# Not a Mac
24+
cursorDate=$(date --date='-1 year' '+%Y-%m-%d')
25+
fi
26+
1927
complete=false
20-
cursorValue=""
28+
cursorValue="${cursorDate}T00:00:00Z"
2129
iterations=0
2230

2331
while [ $complete == false ]; do

0 commit comments

Comments
 (0)