mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
external test scripts: Quote variables properly
This commit is contained in:
+5
-5
@@ -37,21 +37,21 @@ safe_kill()
|
||||
local n=1
|
||||
|
||||
# only proceed if $PID does exist
|
||||
kill -0 $PID 2>/dev/null || return
|
||||
kill -0 "$PID" 2>/dev/null || return
|
||||
|
||||
echo "Sending SIGTERM to ${NAME} (${PID}) ..."
|
||||
kill $PID
|
||||
kill "$PID"
|
||||
|
||||
# wait until process terminated gracefully
|
||||
while kill -0 $PID 2>/dev/null && [[ $n -le 4 ]]; do
|
||||
while kill -0 "$PID" 2>/dev/null && [[ $n -le 4 ]]; do
|
||||
echo "Waiting ($n) ..."
|
||||
sleep 1
|
||||
n=$[n + 1]
|
||||
done
|
||||
|
||||
# process still alive? then hard-kill
|
||||
if kill -0 $PID 2>/dev/null; then
|
||||
if kill -0 "$PID" 2>/dev/null; then
|
||||
echo "Sending SIGKILL to ${NAME} (${PID}) ..."
|
||||
kill -9 $PID
|
||||
kill -9 "$PID"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user