]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Ensure any previous keys are removed at __kvmx_ssh_keygen
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 2 Apr 2017 01:42:30 +0000 (22:42 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 2 Apr 2017 01:42:30 +0000 (22:42 -0300)
lib/kvmx/functions

index df1bd7abc62f3a66a47ea12796915ff7fca32da9..134f4be190d5eab67428d70dd4d86a29da4c545d 100755 (executable)
 # 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
 }