aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarehbein <arehbein@sysmocom.de>2022-11-13 22:28:01 +0100
committerarehbein <arehbein@sysmocom.de>2022-11-25 15:18:48 +0100
commit6ff41c4e036b3813bbcf8784e6369cd87eebe785 (patch)
treeacf870511e98c9001f388d6118a065980b182143
parenta63feac489ace0f69efefd57c861c36085b765ee (diff)
WIP: 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: Ie34eaa778f78b9685dd601d5e9898829caf0c7ca
-rwxr-xr-xttcn3-tcpdump-stop.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/ttcn3-tcpdump-stop.sh b/ttcn3-tcpdump-stop.sh
index 05680541..dc399814 100755
--- a/ttcn3-tcpdump-stop.sh
+++ b/ttcn3-tcpdump-stop.sh
@@ -25,7 +25,8 @@ 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="$(cat /proc/$$/cmdline | tr -d '\0')"
+if [ "$SHELL" = "bash" ]; then
ESCAPE_OPT="-e"
else
ESCAPE_OPT=""