TellStick - Added stdin, clarified desc. and config (#206)

* Added event listener

* Updated version

* Add TellStick Logo

* Update run.sh

* Update config.json

* Update config.json

* Update config.json

* Update config.json

* Variable handling..

* Update run.sh
This commit is contained in:
endor-force
2017-12-04 22:16:46 +01:00
committed by Pascal Vizeli
parent aa02ebf3b9
commit e2e2a76a61
3 changed files with 27 additions and 6 deletions

View File

@@ -56,11 +56,23 @@ for (( i=0; i < "$DEVICES"; i++ )); do
) >> /etc/tellstick.conf
done
echo "[Info] Run telldusd & socat"
echo "[Info] Exposing sockets and loading service"
# Expose the unix socket to internal network
socat TCP-LISTEN:50800,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusClient &
socat TCP-LISTEN:50801,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusEvents &
# Run telldus-core daemon
exec /usr/local/sbin/telldusd --nodaemon < /dev/null
# Run telldus-core daemon in the background
exec /usr/local/sbin/telldusd --nodaemon < /dev/null &
# Listen for input to tdtool
echo "[Info] Starting event listener"
while read -r input; do
# removing JSON stuff
input="$(echo "$input" | jq --raw-output '.')"
echo "[Info] Read alias: $input"
if ! msg="$(tdtool --"$input")"; then
echo "[Error] TellStick Command failed -> $msg"
fi
done