Ensure generated device id is a valid file name

Former-commit-id: 950080785d4666364b5452a4e0b48ce999852ef8 [formerly 3147d9327b]
Former-commit-id: da5d01ac15b077cb2d63668ee9be491ef597a105
This commit is contained in:
2022-10-12 12:32:54 -04:00
parent 60c2920f3c
commit 359edcd46c
+2 -2
View File
@@ -300,8 +300,8 @@ def tweak(): # runs configuration wizard
remove(f"{path.expanduser('~/.config/sshyp/devices/')}{_id}")
print(f"{_divider}\u001b[4;1mimportant:\u001b[0m this id \u001b[4;1mmust\u001b[0m be unique amongst your "
f"client devices\n\nthis is used to keep track of database syncing and quick-unlock permissions\n")
_device_id_prefix = str(input('device id: '))
_device_id_suffix = string_gen('c', randint(12, 48))
_device_id_prefix = str(input('device id: ')) + '-'
_device_id_suffix = string_gen('s', randint(24, 48))
_device_id = _device_id_prefix + _device_id_suffix
open(f"{path.expanduser('~/.config/sshyp/devices/')}{_device_id}", 'w')