aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/kvmx/functions4
1 files changed, 4 insertions, 0 deletions
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
}