ttcn3-tcpdump-stop.sh: Don't use lsof

`lsof` isn't available in the docker image, use /proc fs instead to get
the shell type

Related: OS#5736
Change-Id: I38e132f49b0711d611d08b61c28b3092c991a191
This commit is contained in:
arehbein 2022-11-13 22:28:01 +01:00
parent bf45a5cff8
commit be074e1964
1 changed files with 3 additions and 1 deletions

View File

@ -25,7 +25,9 @@ kill_rm_pidfile() {
date
# -e only works/is required only in Bash; in dash/POSIX shells it isn't required and will be part of the output
if (lsof -p $$ | grep -q /usr/bin/bash); then
# SHELL environment variable doesn't always give name of current shell (e.g. for dash run inside bash...)
SHELL_NAME="$(cat /proc/$$/cmdline | tr -d '\0')"
if [ "$SHELL_NAME" = "bash" ]; then
ESCAPE_OPT="-e"
else
ESCAPE_OPT=""