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/getconfigureddevices.sh
Michael Zanetti 0e7edd5abd cleanup
2019-11-04 10:52:06 +01:00

22 lines
358 B
Bash
Executable File

#!/bin/bash
if [ -z $1 ]; then
echo "usage: $0 host <token>"
exit 1
fi
if [ -z $2 ]; then
cat <<EOD | nc $1 2222 | jq
{"id":0, "method":"JSONRPC.Hello"}
{"id":1, "method":"Devices.GetConfiguredDevices"}
EOD
exit 0
fi
cat <<EOD | nc $1 2222 | jq
{"id":0, "method":"JSONRPC.Hello"}
{"id":1, "token": "$2", "method":"Devices.GetConfiguredDevices"}
EOD