mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-05 16:47:14 -04:00
Add "BACK" button in optional SSH configuration
This commit is contained in:
+7
-2
@@ -191,7 +191,7 @@ def editor_config(_env_mode):
|
|||||||
|
|
||||||
|
|
||||||
# ssh+sshync configuration
|
# ssh+sshync configuration
|
||||||
def ssh_config():
|
def ssh_config(_reconfig=False):
|
||||||
# private key selection/generation
|
# private key selection/generation
|
||||||
_keys = []
|
_keys = []
|
||||||
# ensure ~/.ssh directory exists
|
# ensure ~/.ssh directory exists
|
||||||
@@ -201,7 +201,12 @@ def ssh_config():
|
|||||||
and not _file.endswith('.pub') and isfile(f"{home}/.ssh/{_file}"):
|
and not _file.endswith('.pub') and isfile(f"{home}/.ssh/{_file}"):
|
||||||
_keys.append(f"{home}/.ssh/{_file}")
|
_keys.append(f"{home}/.ssh/{_file}")
|
||||||
_keys.extend(['auto-generate', 'other (type the location)'])
|
_keys.extend(['auto-generate', 'other (type the location)'])
|
||||||
|
# append a back button if launched optionally
|
||||||
|
if _reconfig:
|
||||||
|
_keys.extend(['BACK'])
|
||||||
_key_selected_num = curses_radio(_keys, 'which private ssh key would you like to use for sshyp?')
|
_key_selected_num = curses_radio(_keys, 'which private ssh key would you like to use for sshyp?')
|
||||||
|
if _reconfig and _key_selected_num == len(_keys)-1:
|
||||||
|
return
|
||||||
_gen_index = len(_keys)-2
|
_gen_index = len(_keys)-2
|
||||||
if _key_selected_num >= _gen_index:
|
if _key_selected_num >= _gen_index:
|
||||||
_ssh_key = expanduser(curses_text('enter the location for your private ssh key:\n\n\n\n\n(ctrl+g/enter to '
|
_ssh_key = expanduser(curses_text('enter the location for your private ssh key:\n\n\n\n\n(ctrl+g/enter to '
|
||||||
@@ -550,7 +555,7 @@ def global_menu(_scr, _device_type, _top_message):
|
|||||||
registered_remover()
|
registered_remover()
|
||||||
elif _choice == 2:
|
elif _choice == 2:
|
||||||
if _device_type == 'client':
|
if _device_type == 'client':
|
||||||
ssh_config()
|
ssh_config(True)
|
||||||
else:
|
else:
|
||||||
whitelist_menu()
|
whitelist_menu()
|
||||||
elif _choice == 3:
|
elif _choice == 3:
|
||||||
|
|||||||
Reference in New Issue
Block a user