From 05a747c5baaabe6d8b74adb37e395fb5f75269cf Mon Sep 17 00:00:00 2001 From: darosior Date: Sun, 15 Sep 2019 15:17:46 +0200 Subject: [PATCH] contrib: Make cowsay answer 'init' __________________________________ < I was not plugin specs compliant > ---------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || --- contrib/plugins/cowsay.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/plugins/cowsay.sh b/contrib/plugins/cowsay.sh index 71505fef6..c99542039 100755 --- a/contrib/plugins/cowsay.sh +++ b/contrib/plugins/cowsay.sh @@ -24,6 +24,9 @@ echo '{"jsonrpc":"2.0","id":'"$id"',"result":{"dynamic":true,"options":[],"rpcme # Eg. {"jsonrpc":"2.0","id":5,"method":"init","params":{"options":{},"configuration":{"lightning-dir":"/home/rusty/.lightning","rpc-file":"lightning-rpc","startup":false}}}\n\n read -r JSON read -r _ +id=$(echo "$JSON" | sed 's/.*"id" *: *\([0-9]*\),.*/\1/') + +echo '{"jsonrpc":"2.0","id":'"$id"',"result":{}}' # eg. { "jsonrpc" : "2.0", "method" : "cowsay", "id" : 6, "params" :[ "hello"] } while read -r JSON; do