mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
24 lines
301 B
Bash
Executable File
24 lines
301 B
Bash
Executable File
#!/bin/bash
|
|
|
|
SGV=$1
|
|
DIRECTION=$2
|
|
AT=$3
|
|
OPTS=""
|
|
if [ -n "$AT" ]; then
|
|
OPTS="--date ${AT}"
|
|
fi
|
|
ISO=$(date -Iseconds $OPTS)
|
|
UNIX=$(date +%s $OPTS)
|
|
|
|
(
|
|
cat <<EOF
|
|
{ "sgv": "$SGV",
|
|
"device": "xxx-test-device",
|
|
"direction": "$DIRECTION",
|
|
"dateString": "$ISO",
|
|
"date": $UNIX
|
|
}
|
|
EOF
|
|
) | tr -d '\n'
|
|
echo
|