From ec9cbf04bb90b39d440c1d5be8d51ab0395b3976 Mon Sep 17 00:00:00 2001 From: Alan Nelson <alan.nelson@nebraska.edu> Date: Tue, 15 Sep 2020 18:35:53 +0000 Subject: [PATCH] Fix race condition on fifo creation --- generate_svc_account_key.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_svc_account_key.sh b/generate_svc_account_key.sh index 071dd81..a21cac4 100644 --- a/generate_svc_account_key.sh +++ b/generate_svc_account_key.sh @@ -7,4 +7,4 @@ # read -p 'Service Account: ' account -sudo -u "$account" -H -- bash -c "cd ~; rm -f key key.pub; mkfifo key key.pub && cat key && cat key.pub >> /etc/ssh/authorized_keys/$account & echo \"y\" | ssh-keygen -q -t ed25519 -N \"\" -f key &>/dev/null; rm -f key key.pub" +sudo -u "$account" -H -- bash -c "cd ~; rm -f key key.pub; mkfifo key key.pub; cat key && cat key.pub >> /etc/ssh/authorized_keys/$account & echo \"y\" | ssh-keygen -q -t ed25519 -N \"\" -f key &>/dev/null; rm -f key key.pub" -- GitLab