From 1dca86028a1306655f513512f353a38e10b75d85 Mon Sep 17 00:00:00 2001 From: Liam Crilly Date: Wed, 8 Nov 2023 09:33:38 +0000 Subject: [PATCH] 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(-) 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."