TT#102912 status: report the name of the invoked binary

When invoking `ngcp-config status`, we reported "ngcpcfg":

| [sipwise-lab-trunk] sipwise@sp1:~$ sudo ngcpcfg status
| 2021-12-09 17:30:08 sp1: Checking state of ngcpcfg:
| 2021-12-09 17:30:08 sp1: OK:   has been initialised already
| [...]

While what we should report instead is "ngcpcfg-config", like:

| [sipwise-lab-trunk] sipwise@sp1:~$ sudo ngcp-config status
| 2021-12-09 17:31:31 sp1: Checking state of ngcp-config:
| 2021-12-09 17:31:31 sp1: OK:   has been initialised already
| [...]

Change-Id: If8fc8076fdf1d214baea3c7388ab208947d66a05
mr10.3.1
Michael Prokop 5 years ago
parent 6dabc7a42c
commit 3abb63eaac

@ -52,7 +52,14 @@ check_local_state() {
log_debug "cd $NGCPCTL_MAIN"
cd "$NGCPCTL_MAIN"
log_info "Checking state of ngcpcfg:"
# report either "ngcpcfg" or "ngcp-config", depending on how it was invoked
local invoker
if [ -r "/proc/${PPID:-doesnotexist}/comm" ] ; then
invoker="$( < /proc/$PPID/comm)"
fi
log_info "Checking state of ${invoker:-ngcpcfg}:"
if ! [ -r "${NGCPCTL_MAIN}/.git/HEAD" ] ; then
log_warn "ngcpcfg has not been initialised yet. Execute 'ngcpcfg initialise'."
exit 0

Loading…
Cancel
Save