lighthouse/scripts/local_testnet/kill_processes.sh
Akihito Nakano 5d26050e97 local testnet: Fix an error on startup (#2973)
## Issue Addressed

Resolves https://github.com/sigp/lighthouse/issues/2763#issuecomment-1024858187

## Proposed Changes

- Skip if the line is blank. 👌
2022-01-31 22:55:06 +00:00

20 lines
291 B
Bash
Executable File

#!/usr/bin/env bash
# Kill processes
set -Eeuo pipefail
# First parameter is the file with
# one pid per line.
if [ -f "$1" ]; then
while read pid
do
# handle the case of blank lines
[[ -n "$pid" ]] || continue
echo killing $pid
kill $pid
done < $1
fi