This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-core/tests/scripts/executeaction.sh
2014-04-28 23:52:05 +02:00

17 lines
894 B
Bash
Executable File

#!/bin/bash
if [ -z $3 ]; then
echo "usage: $0 host actionTypeId deviceId [paramname paramvalue] [paramname paramvalue]"
elif [ -z $4 ]; then
(echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{'$2'}", "deviceId":"{'$3'}"}}'; sleep 1) | nc $1 1234
elif [ -z $5 ]; then
echo "usage: $0 host actionTypeId deviceId [paramname paramvalue] [paramname paramvalue]"
elif [ -z $6 ]; then
echo calling.. $4 $5
(echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{'$2'}", "deviceId":"{'$3'}","params":[{"'$4'":"'$5'"}]}}'; sleep 1) | nc $1 1234
elif [ -z $7 ]; then
echo "usage: $0 host actionTypeId deviceId [paramname paramvalue] [paramname paramvalue]"
else
(echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{'$2'}", "deviceId":"{'$3'}","params":[{"'$4'":"'$5'"}, {"'$6'": "'$7'"}]}}'; sleep 1) | nc $1 1234
fi