rtpub.sh 411 B

12345678910111213
  1. #!/bin/bash
  2. ROOT=$(cd `dirname $0`/../../; pwd)
  3. TOPIC=test
  4. URL=http://127.0.0.1:9051/pub?topic=$TOPIC
  5. echo url: $URL
  6. DATE=$(date "+%Y-%m-%d-%H_%M_%S").$((`date "+%-N"`/1000000))
  7. echo date: $DATE
  8. MSG="{\"msg\":\"realtime message\", \"date\":\"$DATE\", \"lantency\":600}"
  9. echo MSGS: $MSG
  10. # curl -d "$MSG" $URL
  11. DATE_STRING="date='$DATE'"
  12. $ROOT/build/bat POST $URL msg="realtime message" $DATE_STRING lantency=600