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
diff --git a/ttcn3-tcpdump-stop.sh b/ttcn3-tcpdump-stop.sh
index 0568054..b479530 100755
--- a/ttcn3-tcpdump-stop.sh
+++ b/ttcn3-tcpdump-stop.sh
@@ -25,7 +25,9 @@
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=""