add remote_cmd, to be used with python -i getsestuff
This commit is contained in:
13
getsestuff
13
getsestuff
@@ -612,16 +612,21 @@ def print_help():
|
||||
print(" replace <instrument> by allin for applying to all instruments")
|
||||
|
||||
|
||||
def remote_cmd(command, instlist=None):
|
||||
# to be used with "python -i getsestuff"
|
||||
for inst in instlist or instruments:
|
||||
print(f'===== {inst} ' + '=' * (70-len(inst)))
|
||||
os.environ['SSHPASS'] = inst.upper()+'LNS'
|
||||
docmd(f'sshpass -e ssh {inst}@{inst} {command}')
|
||||
|
||||
|
||||
if remote:
|
||||
if not doit:
|
||||
action_arg = 'check ' + action_arg
|
||||
if selected_instruments is None:
|
||||
print_help()
|
||||
else:
|
||||
for inst in selected_instruments:
|
||||
print(f'===== {inst} ' + '=' * (70-len(inst)))
|
||||
os.environ['SSHPASS'] = inst.upper()+'LNS'
|
||||
docmd(f'sshpass -e ssh {inst}@{inst} getsestuff {action_arg} nohelp')
|
||||
remote_cmd(f'getsestuff {action_arg} nohelp', selected_instruments)
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user