2021-10-01 06:32:37 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Kill processes
|
|
|
|
|
2022-01-26 23:14:20 +00:00
|
|
|
set -Eeuo pipefail
|
|
|
|
|
2021-10-01 06:32:37 +00:00
|
|
|
# First parameter is the file with
|
|
|
|
# one pid per line.
|
|
|
|
if [ -f "$1" ]; then
|
|
|
|
while read pid
|
|
|
|
do
|
2022-01-31 22:55:06 +00:00
|
|
|
# handle the case of blank lines
|
|
|
|
[[ -n "$pid" ]] || continue
|
|
|
|
|
2021-10-01 06:32:37 +00:00
|
|
|
echo killing $pid
|
|
|
|
kill $pid
|
|
|
|
done < $1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|