From 87dff09afbd09a5a2e849a99cfc48e24ef45c466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Mon, 29 Apr 2019 11:53:15 +0200 Subject: [PATCH] Allowing a second argument to response to specify the value. --- poc/bin/response | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/poc/bin/response b/poc/bin/response index 9113975..225aa83 100755 --- a/poc/bin/response +++ b/poc/bin/response @@ -16,4 +16,11 @@ # limitations under the License. # -curl -sf -X PUT --data-binary @- ${KAPOW_URL}/connections/${KAPOW_CONNECTION}/response$1 +if [ $# -lt 1 ]; then + echo "Response object is mandatory" >&2 + exit 1 +elif [ $# -eq 1 ]; then + curl -N -sf -X PUT --data-binary @- ${KAPOW_URL}/connections/${KAPOW_CONNECTION}/response$1 +else + curl -sf -X PUT --data-binary "$2" ${KAPOW_URL}/connections/${KAPOW_CONNECTION}/response$1 +fi