From a6940d48a2f6e8a1ed8614ab480f1fb6d43f0d66 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 27 May 2017 00:09:02 +0200 Subject: [PATCH] Use kill to check for process existence Signed-off-by: Knut Ahlers --- bin/local-vault-auth | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/local-vault-auth b/bin/local-vault-auth index 55a2007..92525f4 100755 --- a/bin/local-vault-auth +++ b/bin/local-vault-auth @@ -16,13 +16,15 @@ if ! (vault token-lookup 1>/dev/null 2>&1); then fi ${HOME}/bin/vault-user-token & + VUT=$! + echo "Waiting for token to become available" while ! [ -f ${HOME}/.vault-token ]; do # Give the program a moment to get a token echo -n . sleep 0.5 - if ! ( pgrep -q vault-user-token ); then + if ! ( kill -0 $VUT ); then echo "vault-user-token exitted, giving up." exit 1 fi