From 7e9786fe60ab66cc2f0b1383b3614580c1e3333f Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 10 Jul 2023 15:46:07 -0400 Subject: [PATCH] Fixed possibility of attempting to sync from a server installation Former-commit-id: 4ac82c68470f451635c698a244899140e97640b2 Former-commit-id: 8b1381521016f23d1c53c6f1e23d1851a0aa04f0 --- lib/sshyp.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index 8826ad4..1977d6f 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -705,28 +705,29 @@ if __name__ == "__main__": from stweak import wrapped_entry wrapped_entry(device_type) + if arg_count > 0 and success_flag == 0 and arguments[0] != 'sync': + if arguments[0] not in ('help', '-h', 'version', '-v', 'license'): + extension_runner() + else: + print_info() + elif not ssh_error: + if sync_flag: + sync() + elif (arg_count > 0 and arguments[0] == 'sync') or (arg_count > 1 and arguments[1] == 'shear'): + sync('\n') + # PORT START ARGS-SERVER # server arguments else: - if arg_count < 1: - arguments.append('help') - print_info() - elif arg_count == 1 and arguments[0] == 'tweak': + if arg_count == 1 and arguments[0] == 'tweak': success_flag = True from stweak import wrapped_entry wrapped_entry(device_type) - # PORT END ARGS-SERVER - - if arg_count > 0 and success_flag == 0 and arguments[0] != 'sync': - if device_type == 'client' and arguments[0] not in ('help', '-h', 'version', '-v', 'license'): - extension_runner() else: + if arg_count < 1: + arguments.append('help') print_info() - elif not ssh_error: - if sync_flag: - sync() - elif (arg_count > 0 and arguments[0] == 'sync') or (arg_count > 1 and arguments[1] == 'shear'): - sync('\n') + # PORT END ARGS-SERVER except KeyboardInterrupt: print('\n')