From a1e00b4e28d56365b4b5cc4aa44185c4b53f5c33 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 16 Jan 2024 15:37:07 +0000 Subject: White space formatting fixes Closes: --- tools/unitc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/unitc') diff --git a/tools/unitc b/tools/unitc index 4ab5f663..22417266 100755 --- a/tools/unitc +++ b/tools/unitc @@ -1,6 +1,6 @@ #!/bin/bash # unitc - a curl wrapper for configuring NGINX Unit -# https://github.com/nginx/unit/tree/master/tools +# https://github.com/nginx/unit/tree/master/tools # NGINX, Inc. (c) 2023 # Defaults @@ -292,7 +292,7 @@ else exit 1 fi NEW_ELEMENT=$(cat ${CONF_FILES[@]}) - echo $NEW_ELEMENT | jq > /dev/null || exit $? # Test the input is valid JSON before proceeding + echo $NEW_ELEMENT | jq > /dev/null || exit $? # Test the input is valid JSON before proceeding OLD_ARRAY=$($RPC_CMD curl -s $UNIT_CTRL$URI) if [ "$(echo $OLD_ARRAY | jq -r type)" = "array" ]; then echo $OLD_ARRAY | jq ". |= [$NEW_ELEMENT] + ." | $RPC_CMD curl -X PUT --data-binary @- $UNIT_CTRL$URI 2> /tmp/${0##*/}.$$ | $OUTPUT -- cgit From 1dca86028a1306655f513512f353a38e10b75d85 Mon Sep 17 00:00:00 2001 From: Liam Crilly Date: Wed, 8 Nov 2023 09:33:38 +0000 Subject: Tools: disambiguate unitc control socket detection Now that unitd has multiple --control* startup options, locating the address of the control socket requires additional precision. Signed-off-by: Liam Crilly Acked-by: Andrew Clayton Signed-off-by: Andrew Clayton --- tools/unitc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/unitc') diff --git a/tools/unitc b/tools/unitc index 22417266..9b3557c5 100755 --- a/tools/unitc +++ b/tools/unitc @@ -186,9 +186,9 @@ if [ $REMOTE -eq 0 ]; then echo "${0##*/}: WARNING: unable to identify unitd command line parameters for PID $PID, assuming unitd defaults from \$PATH" PARAMS=unitd fi - CTRL_ADDR=$(echo "$PARAMS" | grep '\--control' | cut -f2 -d' ') + CTRL_ADDR=$(echo "$PARAMS" | grep '\--control ' | cut -f2 -d' ') if [ "$CTRL_ADDR" = "" ]; then - CTRL_ADDR=$($(echo "$PARAMS") --help | grep -A1 '\--control' | tail -1 | cut -f2 -d\") + CTRL_ADDR=$($(echo "$PARAMS") --help | grep -A1 '\--control ADDRESS' | tail -1 | cut -f2 -d\") fi if [ "$CTRL_ADDR" = "" ]; then echo "${0##*/}: ERROR: cannot detect control socket. Did you start unitd with a relative path? Try starting unitd with --control option." -- cgit From f71ead5fa5b8bae378a0eca2bedb689cf08a8eff Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 30 Jan 2024 09:14:39 +0000 Subject: Updated copyright notice. --- tools/unitc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/unitc') diff --git a/tools/unitc b/tools/unitc index 9b3557c5..9fba4c6d 100755 --- a/tools/unitc +++ b/tools/unitc @@ -1,7 +1,7 @@ #!/bin/bash # unitc - a curl wrapper for configuring NGINX Unit # https://github.com/nginx/unit/tree/master/tools -# NGINX, Inc. (c) 2023 +# NGINX, Inc. (c) 2024 # Defaults # -- cgit