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/getsupporteddevices.sh
2019-11-01 20:55:45 +01:00

22 lines
366 B
Bash
Executable File

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