Fix bash variable input (#207)
* Fix bash variable input
This will cause error in validation.
i have tried with
if ! msg="$(tdtool --"$input")"; then
if ! msg="$(tdtool --"${input}")"; then
if ! msg="$(tdtool --${input})"; then
without success.
The only one i got working in real life is the one in this PR.
* Trying variable with curlies
Changed frm only output errors to output all output from tdtool.
Enables listing of devices and sensors with output to add-on log.
* Update config.json
* fix not used exec
* fix lint
* update output
This commit is contained in:
committed by
Pascal Vizeli
parent
e2e2a76a61
commit
d5263e9b6e
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TellStick",
|
||||
"version": "0.2",
|
||||
"version": "0.3",
|
||||
"slug": "tellstick",
|
||||
"description": "TellStick and TellStick Duo service.",
|
||||
"url": "https://home-assistant.io/addons/tellstick/",
|
||||
|
||||
@@ -63,7 +63,7 @@ socat TCP-LISTEN:50800,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusClient &
|
||||
socat TCP-LISTEN:50801,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusEvents &
|
||||
|
||||
# Run telldus-core daemon in the background
|
||||
exec /usr/local/sbin/telldusd --nodaemon < /dev/null &
|
||||
/usr/local/sbin/telldusd --nodaemon < /dev/null &
|
||||
|
||||
# Listen for input to tdtool
|
||||
echo "[Info] Starting event listener"
|
||||
@@ -72,7 +72,9 @@ while read -r input; do
|
||||
input="$(echo "$input" | jq --raw-output '.')"
|
||||
echo "[Info] Read alias: $input"
|
||||
|
||||
if ! msg="$(tdtool --"$input")"; then
|
||||
echo "[Error] TellStick Command failed -> $msg"
|
||||
if ! msg="$(tdtool "--$input")"; then
|
||||
echo "[Error] TellStick Command fails -> $msg"
|
||||
else
|
||||
echo "[Info] TellStick Command success -> $msg"
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user