Module: kamailio
Branch: master
Commit: a229d230bca5e785670edc3901f849e93989f9fe
URL:
https://github.com/kamailio/kamailio/commit/a229d230bca5e785670edc3901f849e…
Author: POIROTTE Francois <francois.poirotte(a)csgroup.eu>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-02-17T16:41:08+01:00
kamctl: hide errors raised by "which"
Hide error messages from "which" to avoid polluting kamctl's output
(e.g. when a JSON document is returned) in environments where STDOUT
and STDERR may be combined into a single stream (e.g. containers)
---
Modified: utils/kamctl/kamctl.base
---
Diff:
https://github.com/kamailio/kamailio/commit/a229d230bca5e785670edc3901f849e…
Patch:
https://github.com/kamailio/kamailio/commit/a229d230bca5e785670edc3901f849e…
---
diff --git a/utils/kamctl/kamctl.base b/utils/kamctl/kamctl.base
index 40e4f09b905..08cd4412054 100644
--- a/utils/kamctl/kamctl.base
+++ b/utils/kamctl/kamctl.base
@@ -10,7 +10,7 @@ locate_tool() {
while [ -n "$1" ]
do
if [ -x /usr/bin/which ] ; then
- TOOLPATH=`which $1`
+ TOOLPATH=`which $1 2> /dev/null`
if [ -n "$TOOLPATH" ]; then
return
fi