aboutsummaryrefslogtreecommitdiffstats
path: root/ttcn3-tcpdump-stop.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ttcn3-tcpdump-stop.sh')
-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 f53cf5d1..c1ab9d08 100755
--- a/ttcn3-tcpdump-stop.sh
+++ b/ttcn3-tcpdump-stop.sh
@@ -32,7 +32,8 @@ do
done
if [ -e $PIDFILE ]; then
- if [ "$(id -u)" = "0" ]; then
+ DUMPER="$(ps -q "$(cat "$PIDFILE")" -o comm=)"
+ if [ "$DUMPER" != "sudo" ]; then
kill "$(cat "$PIDFILE")"
else
# NOTE: This requires you to be root or something like