Commit 654517aa authored by Benjamin Graillot's avatar Benjamin Graillot Committed by root

Ajout du script whos

parent 48642875
#!/usr/bin/python3
import os
import shlex
import socket
import subprocess
import sys
if __name__ == '__main__':
host = socket.gethostname()
if host == 're2o-srv':
os.chdir('/var/www/re2o')
subprocess.run(['sudo', './manage.py', 'whos'] + sys.argv[1:])
elif host == 'thot':
os.system('ssh -t re2o.adm.crans.org whos ' + shlex.quote(' '.join([shlex.quote(arg) for arg in sys.argv[1:]])))
else:
print('Commande à lancer uniquement sur thot ou re2o-srv.')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment