Project

General

Profile

1 1855 aaronmk
#!/bin/bash
2 1552 aaronmk
# Stops all running imports
3
4 1952 aaronmk
stop_imports_main ()
5
{
6
    local self="${BASH_SOURCE[0]}"
7
    local selfDir="$(dirname -- "$self")"
8
9 1953 aaronmk
    if test "${BASH_LINENO[1]}" = 0; then # was run without initial "."
10 1952 aaronmk
        echo "Usage: . $self (note initial \".\")"|fold -s >&2
11
        return 2
12
    fi
13
14 13988 aaronmk
    for job in $(jobs|grep -F -e 'make inputs/' -e bin/after_import\
15
|"$selfDir/jobspecs"); do
16 1952 aaronmk
        kill $job
17
    done
18
}
19
stop_imports_main "$@"