From 9ba4b8d7243d2469c91c7425e8c2b1fc1f0a0765 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 24 Sep 2023 14:35:01 -0400 Subject: [PATCH] Added a warning when the user manually attempts to sync in offline mode Former-commit-id: f54591cc6997078a248c5d8dc3dcd533824c04e4 Former-commit-id: fb405077f39e22840e98bca6a854496bd583c49c --- lib/sshyp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index f9a690e..f3f097f 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -603,7 +603,7 @@ if __name__ == "__main__": ssh_error, success_flag, sync_flag, silent_sync, pass_show = False, False, False, False, False # set to avoid PEP8 warnings - arg_start, device_type = None, None + arg_start, device_type, offline_mode_enabled = None, None, None # retrieve typed argument arguments = argv[1:] @@ -715,6 +715,9 @@ if __name__ == "__main__": sync() elif (arg_count > 0 and arguments[0] == 'sync') or (arg_count > 1 and arguments[1] == 'shear'): sync('\n') + elif offline_mode_enabled == 'true': + print("\n\u001b[38;5;9mwarning: sshyp is currently configured in offline mode - ssh synchronization is " + "disabled\n") # PORT START ARGS-SERVER # server arguments