From bccc6e33d394ce12ce89195a3eb0c73c6e2f797a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 1 Apr 2017 22:42:30 -0300 Subject: Ensure any previous keys are removed at __kvmx_ssh_keygen --- lib/kvmx/functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/kvmx/functions b/lib/kvmx/functions index df1bd7a..134f4be 100755 --- a/lib/kvmx/functions +++ b/lib/kvmx/functions @@ -12,6 +12,10 @@ # Generate a keypair function __kvmx_ssh_keygen { if [ ! -z "$2" ]; then + # Ensure any previous keys are removed + rm -f $1 $1.pub + + # Generate the keypair ssh-keygen -t rsa -b 4096 -f $1 -N '' -C $2 fi } -- cgit v1.2.3