mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-02 15:17:18 -04:00
Attempt remote imports from /lib/sshyp, rather than /bin
This commit is contained in:
+3
-2
@@ -27,8 +27,9 @@ def get_titles_mods(_directory, _destination, _user_data): # fetches and return
|
|||||||
open(expanduser('~/.config/sshync/database'), 'a').write(str(_mod) + '\n')
|
open(expanduser('~/.config/sshync/database'), 'a').write(str(_mod) + '\n')
|
||||||
# remote fetching
|
# remote fetching
|
||||||
if _destination == 'r':
|
if _destination == 'r':
|
||||||
system(f"ssh -i '{_user_data[5]}' -p {_user_data[2]} {_user_data[0]}@{_user_data[1]} \"cd /bin; python -c 'impo"
|
system(f"ssh -i '{_user_data[5]}' -p {_user_data[2]} {_user_data[0]}@{_user_data[1]} \"cd /lib/sshyp; python -c"
|
||||||
f"rt sshync; sshync.get_titles_mods(\"'\"{_user_data[4]}\"'\", \"'\"l\"'\", \"'\"{_user_data}\"'\")'\"")
|
f" 'import sshync; sshync.get_titles_mods(\"'\"{_user_data[4]}\"'\", \"'\"l\"'\", \"'\"{_user_data}"
|
||||||
|
f"\"'\")'\"")
|
||||||
system(f"scp -pqs -P {_user_data[2]} -i '{_user_data[5]}' {_user_data[0]}@{_user_data[1]}:"
|
system(f"scp -pqs -P {_user_data[2]} -i '{_user_data[5]}' {_user_data[0]}@{_user_data[1]}:"
|
||||||
f"'/home/{_user_data[0]}/.config/sshync/database' '{expanduser('~/.config/sshync/')}'")
|
f"'/home/{_user_data[0]}/.config/sshync/database' '{expanduser('~/.config/sshync/')}'")
|
||||||
_titles, _sep, _mods = '*&^'.join(open(expanduser('~/.config/sshync/database')).readlines()).replace('\n', '')\
|
_titles, _sep, _mods = '*&^'.join(open(expanduser('~/.config/sshync/database')).readlines()).replace('\n', '')\
|
||||||
|
|||||||
+4
-4
@@ -471,7 +471,7 @@ def read_shortcut(): # shortcut to quickly read an entry
|
|||||||
def sync(): # calls sshync to sync changes to the user's server
|
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} \"cd /bin; python -c "
|
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"cd /lib/sshyp; python -c "
|
||||||
f"'import sshypRemote; sshypRemote.deletion_check(\"'\"{client_device_id}\"'\")'\"")
|
f"'import sshypRemote; sshypRemote.deletion_check(\"'\"{client_device_id}\"'\")'\"")
|
||||||
system(f"scp -pqs -P {port} -i '{path.expanduser('~/.ssh/sshyp')}' {username_ssh}@{ip}:'/home/{username_ssh}"
|
system(f"scp -pqs -P {port} -i '{path.expanduser('~/.ssh/sshyp')}' {username_ssh}@{ip}:'/home/{username_ssh}"
|
||||||
f"/.config/sshyp/deletion_database' {path.expanduser('~/.config/sshyp/')}")
|
f"/.config/sshyp/deletion_database' {path.expanduser('~/.config/sshyp/')}")
|
||||||
@@ -493,7 +493,7 @@ def sync(): # calls sshync to sync changes to the user's server
|
|||||||
if silent_sync != 1:
|
if silent_sync != 1:
|
||||||
print('location does not exist locally')
|
print('location does not exist locally')
|
||||||
# check for new folders
|
# check for new folders
|
||||||
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"cd /bin; python -c "
|
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"cd /lib/sshyp; python -c "
|
||||||
f"'import sshypRemote; sshypRemote.folder_check()'\"")
|
f"'import sshypRemote; sshypRemote.folder_check()'\"")
|
||||||
system(f"scp -pqs -P {port} -i '{path.expanduser('~/.ssh/sshyp')}' {username_ssh}@{ip}:'/home/{username_ssh}"
|
system(f"scp -pqs -P {port} -i '{path.expanduser('~/.ssh/sshyp')}' {username_ssh}@{ip}:'/home/{username_ssh}"
|
||||||
f"/.config/sshyp/folder_database' {path.expanduser('~/.config/sshyp/')}")
|
f"/.config/sshyp/folder_database' {path.expanduser('~/.config/sshyp/')}")
|
||||||
@@ -667,7 +667,7 @@ def rename(): # renames an entry or folder
|
|||||||
else:
|
else:
|
||||||
move(f"{directory}{_entry_name}.gpg", f"{directory}{_new_name}.gpg")
|
move(f"{directory}{_entry_name}.gpg", f"{directory}{_new_name}.gpg")
|
||||||
if ssh_error != 1:
|
if ssh_error != 1:
|
||||||
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"cd /bin; python -c "
|
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"cd /lib/sshyp; python -c "
|
||||||
f"'import sshypRemote; sshypRemote.delete(\"'\"{_entry_name}\"'\", 'remotely')'\"")
|
f"'import sshypRemote; sshypRemote.delete(\"'\"{_entry_name}\"'\", 'remotely')'\"")
|
||||||
|
|
||||||
|
|
||||||
@@ -800,7 +800,7 @@ def remove_data(): # deletes an entry from the server and flags it for local de
|
|||||||
_entry_name = entry_name_fetch(1)
|
_entry_name = entry_name_fetch(1)
|
||||||
decrypt(path.expanduser('~/.config/sshyp/lock.gpg'), 0, 0, gpg)
|
decrypt(path.expanduser('~/.config/sshyp/lock.gpg'), 0, 0, gpg)
|
||||||
if ssh_error != 1:
|
if ssh_error != 1:
|
||||||
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"cd /bin; python -c "
|
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"cd /lib/sshyp; python -c "
|
||||||
f"'import sshypRemote; sshypRemote.delete(\"'\"{_entry_name}\"'\", 'remotely')'\"")
|
f"'import sshypRemote; sshypRemote.delete(\"'\"{_entry_name}\"'\", 'remotely')'\"")
|
||||||
else:
|
else:
|
||||||
from sshypRemote import delete as offline_delete
|
from sshypRemote import delete as offline_delete
|
||||||
|
|||||||
Reference in New Issue
Block a user