diff options
author | Karel Kočí <cynerd@email.cz> | 2022-10-13 16:18:15 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-10-13 16:18:15 +0200 |
commit | 9eb1eabfb13c3a88b0a6fd4832bd76c4ba5a1159 (patch) | |
tree | b9e864b44f6b14ac5fb79aa58792dcac17fcbaa7 /shellrc-desktop.d | |
parent | 43bd5ac8b20f0f846da6c067eba4058b86daa0fb (diff) | |
download | shellrc-9eb1eabfb13c3a88b0a6fd4832bd76c4ba5a1159.tar.gz shellrc-9eb1eabfb13c3a88b0a6fd4832bd76c4ba5a1159.tar.bz2 shellrc-9eb1eabfb13c3a88b0a6fd4832bd76c4ba5a1159.zip |
shellrc-desktop.d/ssh: fix for Nix
Diffstat (limited to 'shellrc-desktop.d')
-rw-r--r-- | shellrc-desktop.d/ssh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/shellrc-desktop.d/ssh b/shellrc-desktop.d/ssh index 7a1b71f..0de644e 100644 --- a/shellrc-desktop.d/ssh +++ b/shellrc-desktop.d/ssh @@ -10,9 +10,15 @@ sshcfs() { shift 3 [[ "$local_dir" = /* ]] || local_dir="$PWD/$local_dir" + local sftp_server="/usr/lib64/misc/sftp-server" + if [ -e /run/current-system/sw/bin/ssh ]; then + sftp_server="$(readlink -f /run/current-system/sw/bin/ssh)" + sftp_server="${sftp_server%/bin/ssh}/libexec/sftp-server" + fi + ssh "$@" "$target" mkdir -p "$remote_dir" dpipe \ - /usr/lib64/misc/sftp-server \ + "$sftp_server" \ = \ ssh "$@" "$target" sshfs -o idmap=user -o passive -o allow_other \ ":$local_dir" "$remote_dir" |