mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
contrib: fix id parsing in IO loop of cowsay.sh plugin
This commit is contained in:
parent
e6d23b5677
commit
dae6a0bcf2
@ -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…
Reference in New Issue
Block a user