Use kill to check for process existence
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
1fb4cfcfce
commit
a6940d48a2
1 changed files with 3 additions and 1 deletions
|
@ -16,13 +16,15 @@ if ! (vault token-lookup 1>/dev/null 2>&1); then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${HOME}/bin/vault-user-token &
|
${HOME}/bin/vault-user-token &
|
||||||
|
VUT=$!
|
||||||
|
|
||||||
echo "Waiting for token to become available"
|
echo "Waiting for token to become available"
|
||||||
while ! [ -f ${HOME}/.vault-token ]; do
|
while ! [ -f ${HOME}/.vault-token ]; do
|
||||||
# Give the program a moment to get a token
|
# Give the program a moment to get a token
|
||||||
echo -n .
|
echo -n .
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
||||||
if ! ( pgrep -q vault-user-token ); then
|
if ! ( kill -0 $VUT ); then
|
||||||
echo "vault-user-token exitted, giving up."
|
echo "vault-user-token exitted, giving up."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue