13 lines
162 B
Plaintext
13 lines
162 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
set +e
|
||
|
COUNT=0
|
||
|
while [ "$COUNT" -le "$2" ]; do
|
||
|
ps -u "$1"
|
||
|
if [ "$?" != "0" ]; then
|
||
|
exit 0
|
||
|
fi
|
||
|
sleep 1
|
||
|
COUNT=$(($COUNT + 1))
|
||
|
done
|
||
|
exit 1
|