Fixed things

This commit is contained in:
2021-11-11 18:47:19 +01:00
parent fbee178ad2
commit f67835393f
3 changed files with 18 additions and 12 deletions

View File

@ -259,6 +259,20 @@ def run_xml(outdir:str, hostname:str, ram:int, net:str):
)
def run_ssh(outdir:str, hostname:str, ipaddr:str):
if not ipaddr:
return
sshout_file = os.path.join(outdir, 'ssh_config')
with open(sshout_file, 'at') as f:
f.write("\n".join([
f"Host {hostname}",
f"\tHostName {ipaddr}",
f"\tProxyJump luna",
"",""
]))
def main():
if len(sys.argv) < 3:
@ -270,7 +284,7 @@ def main():
img_src = sys.argv[3]
outdir = sys.argv[4]
if stage not in ['all', 'img', 'iso', 'xml']:
if stage not in ['all', 'img', 'iso', 'xml', 'ssh']:
print("Stage should be: all, img, iso or xml")
return
@ -296,6 +310,8 @@ def main():
if stage in ['xml', 'all']:
run_xml(outdir,hostname, ram, net)
if stage in ['ssh', 'all']:
run_ssh(outdir, hostname, ipaddr)
if __name__ == "__main__":
main()