Browse Source

contrib: Make cowsay answer 'init'

__________________________________
< I was not plugin specs compliant >
 ----------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
travis-debug
darosior 5 years ago
committed by Rusty Russell
parent
commit
05a747c5ba
  1. 3
      contrib/plugins/cowsay.sh

3
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 # 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 JSON
read -r _ 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"] } # eg. { "jsonrpc" : "2.0", "method" : "cowsay", "id" : 6, "params" :[ "hello"] }
while read -r JSON; do while read -r JSON; do

Loading…
Cancel
Save