add remote_cmd, to be used with python -i getsestuff

This commit is contained in:
2025-07-08 11:28:38 +02:00
parent acd785061c
commit 77876562f1

View File

@@ -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)