From 0fbe084ff7179f616e31855afcc759111ea53b06 Mon Sep 17 00:00:00 2001 From: Randall Date: Sat, 8 Oct 2022 21:33:35 -0400 Subject: [PATCH] Correctly add strings to config file list Former-commit-id: 7defa79968068b45f64deb0f7df183650ce111b5 [formerly cc4324f9530b13b76a93d88507f692b0744e9e81] Former-commit-id: a431ad4d3e40a85658d59b03455fbabc0667e41e --- bin/sshyp.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/sshyp.py b/bin/sshyp.py index ce7258b..bbc3252 100755 --- a/bin/sshyp.py +++ b/bin/sshyp.py @@ -233,7 +233,7 @@ def tweak(): # runs configuration wizard f" new one? (E/g) ") if _gpg_gen.lower() != 'g': system(f"{gpg} -k") - _sshyp_data += str(input('gpg key id: ')) + _sshyp_data += [str(input('gpg key id: '))] else: print('\na unique gpg key is being generated for you...') if not Path(path.expanduser('~/.config/sshyp/gpg-gen')).is_file(): @@ -247,10 +247,10 @@ def tweak(): # runs configuration wizard else: run(f"{gpg} --batch --generate-key '{path.expanduser('~/.config/sshyp/gpg-gen')}'", shell=True) remove(path.expanduser('~/.config/sshyp/gpg-gen')) - _sshyp_data += run(f"{gpg} -k", shell=True, stdout=PIPE, text=True).stdout.split('\n')[-4].strip() + _sshyp_data += [run(f"{gpg} -k", shell=True, stdout=PIPE, text=True).stdout.split('\n')[-4].strip()] # text editor configuration - _sshyp_data += input(f"{_divider}example input: vim\n\npreferred text editor: ") + _sshyp_data += [input(f"{_divider}example input: vim\n\npreferred text editor: ")] # lock file generation if Path(path.expanduser('~/.config/sshyp/lock.gpg')).is_file(): @@ -303,14 +303,14 @@ def tweak(): # runs configuration wizard f"requires a constant connection to your sshyp server to authenticate\n") _quick_unlock_enabled = input('enable quick-unlock? (y/N)') if _quick_unlock_enabled.lower() == 'y': - _sshyp_data += 'quick' - _sshyp_data += int(input('this must be half the number of characters in your gpg key password or ' - 'shorter\n\nquick-unlock key length: ')) + _sshyp_data += ['quick'] + _sshyp_data += [int(input('this must be half the number of characters in your gpg key password or ' + 'shorter\n\nquick-unlock key length: '))] print(f"\nquick-unlock has been enabled client-side - in order for this device to be able to read " f"entries,\nyou must first login to the sshyp server and run:\n\nsshyp whitelist add " f"{_device_id}") else: - _sshyp_data += 'slow', 0 + _sshyp_data += ['slow'], 0 # test server connection and attempt to register device id copy_id_check(_port, _username_ssh, _ip, _device_id)