arehbein submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve arehbein: Looks good to me, approved Objections: msuraev: I would prefer this is not merged as is
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(-)

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-Reviewer: Jenkins Builder
Gerrit-Reviewer: arehbein <arehbein@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: msuraev <msuraev@sysmocom.de>
Gerrit-MessageType: merged