mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-31 06:16:29 -04:00
Automatically remove old device names locally
This commit is contained in:
@@ -107,6 +107,8 @@ def tweak(): # runs configuration wizard
|
||||
path.expanduser('~/.ssh/sshyp'), _ip, _port, _username_ssh)
|
||||
|
||||
# device name configuration
|
||||
for _name in listdir(path.expanduser('~/.config/sshyp/devices')): # remove existing device name
|
||||
remove(f"{path.expanduser('~/.config/sshyp/devices/')}{_name}")
|
||||
print('\nIMPORTANT: This name MUST be unique amongst your client devices. '
|
||||
'\nThis is used to keep track of which devices have up-to-date databases.\n')
|
||||
_client_device_name = str(input('What would you like to name this device? '))
|
||||
@@ -243,7 +245,7 @@ def sync(): # calls sshync to sync changes to the user's server
|
||||
_folder_database = None
|
||||
s_exit()
|
||||
for _folder in _folder_database:
|
||||
if Path(f"{path.expanduser('~/.password-pasture/')}{_folder[:-1]}").exists():
|
||||
if Path(f"{path.expanduser('~/.password-pasture/')}{_folder[:-1]}").is_dir():
|
||||
pass
|
||||
else:
|
||||
Path(f"{path.expanduser('~/.password-pasture/')}{_folder[:-1]}").mkdir(0o700, parents=True, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user