projects
/
rtl433-sensors
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0a88ab
)
insert json from mqtt into postgresql
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 3 Aug 2017 10:51:48 +0000
(12:51 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 3 Aug 2017 10:51:48 +0000
(12:51 +0200)
mqtt-pgsql.sh
[new file with mode: 0755]
patch
|
blob
diff --git a/mqtt-pgsql.sh
b/mqtt-pgsql.sh
new file mode 100755
(executable)
index 0000000..
c0d56fa
--- /dev/null
+++ b/
mqtt-pgsql.sh
@@ -0,0
+1,6
@@
+#!/bin/sh -xe
+
+mosquitto_sub -h 10.13.37.5 -t rpi2/rtl433/json | while read json ; do
+ echo $json > /dev/shm/rtl433.json
+ psql -c "copy rtl433 (json) from '/dev/shm/rtl433.json'" rot13
+done