arehbein has uploaded this change for review.

View Change

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
---
M ttcn3-tcpdump-stop.sh
1 file changed, 3 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/13/30313/1
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=""

To view, visit change 30313. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I38e132f49b0711d611d08b61c28b3092c991a191
Gerrit-Change-Number: 30313
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein <arehbein@sysmocom.de>
Gerrit-MessageType: newchange