summaryrefslogtreecommitdiffstats
path: root/build-gluster-org/scripts/rpm-cleanup.sh
blob: bd300c7e8087cc09c2151b985f9790bcba38d8e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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