mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
contrib: fix id parsing in IO loop of cowsay.sh plugin
This commit is contained in:
parent
e6d23b5677
commit
dae6a0bcf2
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ echo '{"jsonrpc":"2.0","id":'"$id"',"result":{}}'
|
|||
# eg. { "jsonrpc" : "2.0", "method" : "cowsay", "id" : 6, "params" :[ "hello"] }
|
||||
while read -r JSON; do
|
||||
read -r _
|
||||
id=$(echo "$JSON" | sed 's/.*"id" *: *\([0-9]*\),.*/\1/')
|
||||
id=$(echo "$JSON" | sed 's/.*"id" *: *\([^,]*\),.*/\1/')
|
||||
params=$(echo "$JSON" | sed 's/.*"params" *: *//' | tr -d '[{}]"')
|
||||
echo '{"jsonrpc":"2.0","id":'"$id"',"result":{"format-hint":"simple","cowsay":"'
|
||||
# FIXME: lightning-cli does not unescape \\, so we replace with an L.
|
||||
|
|
Loading…
Add table
Reference in a new issue