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")
|
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 remote:
|
||||||
if not doit:
|
if not doit:
|
||||||
action_arg = 'check ' + action_arg
|
action_arg = 'check ' + action_arg
|
||||||
if selected_instruments is None:
|
if selected_instruments is None:
|
||||||
print_help()
|
print_help()
|
||||||
else:
|
else:
|
||||||
for inst in selected_instruments:
|
remote_cmd(f'getsestuff {action_arg} nohelp', 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')
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user