Created
July 24, 2025 10:10
-
-
Save floitsch/1aee727238cafc94ed12bf824ff07fa1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # from https://github.com/rom1v/rsshfs/blob/master/rsshfs | |
| # from https://hg.slitaz.org/wok/rev/c2a6bbd5b24f | |
| rhost="${2%%:*}" | |
| rpath="${2#*:}" | |
| lpath="$1" | |
| case "$1" in | |
| -u) ssh "$rhost" fusermount -u "$rpath" | |
| ;; | |
| ''|-*) cat <<EOT | |
| usage: | |
| $0 localpath remotehost:remotepath [-o ro -o allow_other] | |
| $0 -u remotehost:remotepath | |
| EOT | |
| ;; | |
| *) fifo=/tmp/rsshfs-fifo$$ | |
| shift 2 | |
| mkfifo $fifo | |
| /usr/sbin/sftp-server < $fifo | \ | |
| ssh "$rhost" sshfs -o slave ":$lpath" "$rpath" "$@" > $fifo | |
| rm -f $fifo | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment