Prevent accidental .ssh overwrite fuck up
This commit is contained in:
parent
63b959c8cd
commit
7b00e6d893
22
service.py
22
service.py
@ -135,16 +135,18 @@ def create_env(args: argparse.Namespace):
|
|||||||
# Generate .ssh
|
# Generate .ssh
|
||||||
ssh_dir = path.join(env_path, ".ssh")
|
ssh_dir = path.join(env_path, ".ssh")
|
||||||
Path(ssh_dir).mkdir(exist_ok=True)
|
Path(ssh_dir).mkdir(exist_ok=True)
|
||||||
ssh_key_cmd = [
|
rsa_path = path.join(ssh_dir, "id_rsa")
|
||||||
"ssh-keygen",
|
if not Path(rsa_path).exists():
|
||||||
"-t",
|
ssh_key_cmd = [
|
||||||
"rsa",
|
"ssh-keygen",
|
||||||
"-b",
|
"-t",
|
||||||
"2048",
|
"rsa",
|
||||||
"-f",
|
"-b",
|
||||||
path.join(ssh_dir, "id_rsa"),
|
"2048",
|
||||||
]
|
"-f",
|
||||||
sub.call(ssh_key_cmd)
|
rsa_path,
|
||||||
|
]
|
||||||
|
sub.call(ssh_key_cmd)
|
||||||
|
|
||||||
# Provision and configure machines
|
# Provision and configure machines
|
||||||
sub.call(["vagrant", "up"], cwd=env_path)
|
sub.call(["vagrant", "up"], cwd=env_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user