Prevent accidental .ssh overwrite fuck up

This commit is contained in:
strNophix 2022-03-15 08:35:34 +01:00
parent 63b959c8cd
commit 7b00e6d893

View File

@ -135,6 +135,8 @@ def create_env(args: argparse.Namespace):
# Generate .ssh
ssh_dir = path.join(env_path, ".ssh")
Path(ssh_dir).mkdir(exist_ok=True)
rsa_path = path.join(ssh_dir, "id_rsa")
if not Path(rsa_path).exists():
ssh_key_cmd = [
"ssh-keygen",
"-t",
@ -142,7 +144,7 @@ def create_env(args: argparse.Namespace):
"-b",
"2048",
"-f",
path.join(ssh_dir, "id_rsa"),
rsa_path,
]
sub.call(ssh_key_cmd)