summaryrefslogtreecommitdiffstats
path: root/build-gluster-org/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'build-gluster-org/scripts')
-rw-r--r--build-gluster-org/scripts/rpm-cleanup.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/build-gluster-org/scripts/rpm-cleanup.sh b/build-gluster-org/scripts/rpm-cleanup.sh
new file mode 100644
index 0000000..bd300c7
--- /dev/null
+++ b/build-gluster-org/scripts/rpm-cleanup.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+pkill mock || true
+SLEEP=0
+while [ $SLEEP -lt 30 ]
+do
+ echo "Waiting for mock to exit cleanly. Attempt #: $SLEEP"
+ sleep 1
+ pgrep -x mock
+ if [ $? -eq 1 ]
+ then
+ exit 0
+ fi
+ SLEEP=$((SLEEP+1))
+done
+echo "Force-killing mock"
+pkill -9 mock