wok-6.x view sshfs-fuse/stuff/rsshfs @ rev 16756
sshfs-fuse: add rsshfs
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jun 16 19:07:54 2014 +0200 (2014-06-16) |
parents | |
children | c176489f467b |
line source
1 #!/bin/sh
2 # from https://github.com/rom1v/rsshfs/blob/master/rsshfs
4 rhost="${2%:*}"
5 rpath="${2#*:}"
6 lpath="$1"
8 case "$2" in
9 -u) ssh "$rhost" fusermount -u "$rpath"
10 ;;
12 ''|-*) cat <<EOT
13 usage:
14 $0 localpath remotehost:remotepath [-o ro -o allow_other]
15 $0 -u remotehost:remotepath
16 EOT
17 ;;
19 *) fifo=/tmp/rsshfs-fifo$$
20 shift 2
21 mkfifo $fifo
22 /usr/sbin/sftp-server < $fifo | \
23 ssh "$rhost" sshfs -o slave ":$lpath" "$rpath" "$@" > $fifo
24 rm -f $fifo
25 esac