File: functions.sh

package info (click to toggle)
python-oslo.messaging 8.1.4-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,108 kB
  • sloc: python: 17,845; sh: 454; makefile: 19
file content (22 lines) | stat: -rw-r--r-- 393 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

wait_for_line () {
    while read line
    do
        echo "$line" | grep -q "$1" && break
        echo "$line" | grep "$2" && exit 1
    done < "$3"
    # Read the fifo for ever otherwise process would block
    cat "$3" >/dev/null &
}

function clean_exit(){
    local error_code="$?"
    for job in `jobs -p`
    do
        kill -9 $job
    done
    rm -rf "$1"
    return $error_code
}