From cbd7f10c259f9c1f1f0c0458f86fa4e94532e98f Mon Sep 17 00:00:00 2001
From: Alan Nelson <alan.nelson@nebraska.edu>
Date: Tue, 11 Aug 2020 23:37:42 +0000
Subject: [PATCH] Ensure temp files are cleaned up

---
 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 e7a8545..071dd81 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 ~; 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 key key.pub"
\ No newline at end of file
+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