arehbein has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30313 )
Change subject: ttcn3-tcpdump-stop.sh: Don't use lsof
......................................................................
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(-)
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
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
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30313
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I38e132f49b0711d611d08b61c28b3092c991a191
Gerrit-Change-Number: 30313
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-MessageType: merged