rtpub2.sh 406 B

1234567891011121314
  1. #!/bin/bash
  2. ROOT=$(cd `dirname $0`/../../; pwd)
  3. TOPIC=topic2
  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\":\"topic2 message\", \"date\":\"$DATE\", \"priority\":2}"
  9. echo MSGS: $MSG
  10. # curl -d "$MSG" $URL
  11. DATE_STRING="date='$DATE'"
  12. $ROOT/build/bat POST $URL msg="topic2 message" $DATE_STRING priority=2