mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-06 00:57:14 -04:00
Rename deletion check function
This commit is contained in:
@@ -211,7 +211,7 @@ def sync(): # calls sshync to sync changes to the user's server
|
|||||||
print('\nSyncing entries with the server device...\n')
|
print('\nSyncing entries with the server device...\n')
|
||||||
# check for deletions
|
# check for deletions
|
||||||
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"python -c 'import sshyp-remote"
|
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"python -c 'import sshyp-remote"
|
||||||
f"; shear.check(\"'\"{client_device_name}\"'\")'\"")
|
f"; shear.deletion_check(\"'\"{client_device_name}\"'\")'\"")
|
||||||
system(f"sftp -p -q -i '{path.expanduser('~/.ssh/sshyp')}' -P {port} {username_ssh}@{ip}:"
|
system(f"sftp -p -q -i '{path.expanduser('~/.ssh/sshyp')}' -P {port} {username_ssh}@{ip}:"
|
||||||
f"'/home/{username_ssh}/.config/sshyp/deletion_database' {path.expanduser('~/.config/sshyp/')}")
|
f"'/home/{username_ssh}/.config/sshyp/deletion_database' {path.expanduser('~/.config/sshyp/')}")
|
||||||
try:
|
try:
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ def delete(_file_path):
|
|||||||
open(f"{expanduser('~/.config/sshyp/deleted/')}{_file_path.replace('/', '@')}^&*{_device_name}", 'w')
|
open(f"{expanduser('~/.config/sshyp/deleted/')}{_file_path.replace('/', '@')}^&*{_device_name}", 'w')
|
||||||
|
|
||||||
|
|
||||||
def check(_client_device_name):
|
def deletion_check(_client_device_name):
|
||||||
open(expanduser('~/.config/sshyp/deletion_database'), 'w').write('')
|
open(expanduser('~/.config/sshyp/deletion_database'), 'w').write('')
|
||||||
for _file in listdir(expanduser('~/.config/sshyp/deleted')):
|
for _file in listdir(expanduser('~/.config/sshyp/deleted')):
|
||||||
_file_path = _file.replace('@', '/').split('^&*')[0]
|
_file_path = _file.replace('@', '/').split('^&*')[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user