wok diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/sshfs-fuse/stuff/rsshfs Mon Jun 16 19:07:54 2014 +0200 1.3 @@ -0,0 +1,25 @@ 1.4 +#!/bin/sh 1.5 +# from https://github.com/rom1v/rsshfs/blob/master/rsshfs 1.6 + 1.7 +rhost="${2%:*}" 1.8 +rpath="${2#*:}" 1.9 +lpath="$1" 1.10 + 1.11 +case "$2" in 1.12 +-u) ssh "$rhost" fusermount -u "$rpath" 1.13 + ;; 1.14 + 1.15 +''|-*) cat <<EOT 1.16 +usage: 1.17 + $0 localpath remotehost:remotepath [-o ro -o allow_other] 1.18 + $0 -u remotehost:remotepath 1.19 +EOT 1.20 + ;; 1.21 + 1.22 +*) fifo=/tmp/rsshfs-fifo$$ 1.23 + shift 2 1.24 + mkfifo $fifo 1.25 + /usr/sbin/sftp-server < $fifo | \ 1.26 + ssh "$rhost" sshfs -o slave ":$lpath" "$rpath" "$@" > $fifo 1.27 + rm -f $fifo 1.28 +esac