diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:39:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:39:52 +0000 |
commit | a95cd20bb8e569c5a5f43808555e90ea436b858f (patch) | |
tree | 7fb27265ca110c329d4d42336c979cab09fff04e /debian/building-in-ci.sh | |
parent | Adding upstream version 1:7.0.3. (diff) | |
download | suricata-a95cd20bb8e569c5a5f43808555e90ea436b858f.tar.xz suricata-a95cd20bb8e569c5a5f43808555e90ea436b858f.zip |
Adding debian version 1:7.0.3-1.debian/1%7.0.3-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/building-in-ci.sh')
-rwxr-xr-x | debian/building-in-ci.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/building-in-ci.sh b/debian/building-in-ci.sh new file mode 100755 index 0000000..ccf552d --- /dev/null +++ b/debian/building-in-ci.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# this script prints 'true' if any ancestor process name is any of $REGEXPS + +REGEXPS="debci autopkgtest adt" + +set -e + +walk() +{ + pid=$1 + + [ ! -r /proc/$pid/cmdline ] && exit 1 + + name=$(ps -p $pid -o cmd | tail -1) + for exp in $REGEXPS + do + if grep -e $exp <<< $name >/dev/null ; then + echo true + exit + fi + done + + ppid=$(ps -o ppid= $pid | tr -d ' ') + walk $ppid +} + +walk $$ |