From: Dobrica Pavlinusic Date: Thu, 3 Aug 2017 10:51:48 +0000 (+0200) Subject: insert json from mqtt into postgresql X-Git-Url: http://git.rot13.org/?p=rtl433-sensors;a=commitdiff_plain;h=ac143194532ddd95d689ca205671ef743aa07002 insert json from mqtt into postgresql --- diff --git a/mqtt-pgsql.sh b/mqtt-pgsql.sh new file mode 100755 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