aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-10-13 16:18:15 +0200
committerKarel Kočí <cynerd@email.cz>2022-10-13 16:18:15 +0200
commit9eb1eabfb13c3a88b0a6fd4832bd76c4ba5a1159 (patch)
treeb9e864b44f6b14ac5fb79aa58792dcac17fcbaa7
parent43bd5ac8b20f0f846da6c067eba4058b86daa0fb (diff)
downloadshellrc-9eb1eabfb13c3a88b0a6fd4832bd76c4ba5a1159.tar.gz
shellrc-9eb1eabfb13c3a88b0a6fd4832bd76c4ba5a1159.tar.bz2
shellrc-9eb1eabfb13c3a88b0a6fd4832bd76c4ba5a1159.zip
shellrc-desktop.d/ssh: fix for Nix
-rw-r--r--shellrc-desktop.d/ssh8
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"