Mercurial > hg > python
changeset 40:f13017bb4502
works on markup with -v ecclerig...
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Mon, 03 Jan 2022 19:19:20 +0000 |
parents | a0b702a76872 |
children | 900ff99ec749 |
files | newkey.py |
diffstat | 1 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/newkey.py Mon Jan 03 14:17:17 2022 +0000 +++ b/newkey.py Mon Jan 03 19:19:20 2022 +0000 @@ -57,8 +57,7 @@ if clients[0]!='-': print("Note, %s will be dereferenced on paul, not locally"%clients, file=sys.stderr) - cmd="/home/ht/bin/newkey.py %s -i %s %s"%(keytype, - "-v %s"%ihost if ihost is not None else '', + cmd="/home/ht/bin/newkey.py %s -i %s"%(keytype, '%s'%clients if clients is not None else '') print(cmd) res=os.system("mkdir -p /tmp/keys ; cd /tmp ; bash -c 'cp -a %s keys' ; tar -czf keys.tar.gz keys"%os.path.expanduser("~/.ssh/id_%s{,.pub}"%keytype)) @@ -66,10 +65,17 @@ print("tar failed",res) exit(res) with open("/tmp/keys.tar.gz","rb") as keytar: - res=run(['ssh','paul',cmd],stdin=keytar).returncode - if res: - print("paul failed",res) - exit(res) + if ihost is None: + res=run(['ssh','paul',cmd],stdin=keytar).returncode + if res: + print("paul failed",res) + exit(res) + else: + res=run(['ssh',ihost,'/afs/inf.ed.ac.uk/user/h/ht/share/bin/goHome',cmd],stdin=keytar).returncode + if res: + print("going via %s failed"%ihost,res) + exit(res) + if clients[0]=='-': ssh_copy_id(keyfile,clients[3:])