Module: kamailio Branch: master Commit: a229d230bca5e785670edc3901f849e93989f9fe URL: https://github.com/kamailio/kamailio/commit/a229d230bca5e785670edc3901f849e9...
Author: POIROTTE Francois francois.poirotte@csgroup.eu Committer: Daniel-Constantin Mierla miconda@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/a229d230bca5e785670edc3901f849e9... Patch: https://github.com/kamailio/kamailio/commit/a229d230bca5e785670edc3901f849e9...
---
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