wok view sshfs-fuse/stuff/rsshfs @ rev 22991

updated l3afpad (0.8.18.1.10 -> 0.8.18.1.11)
author Hans-G?nter Theisgen
date Sun Mar 01 17:39:44 2020 +0100 (2020-03-01)
parents fc1b98958191
children
line source
1 #!/bin/sh
2 # from https://github.com/rom1v/rsshfs
4 rhost="${2%%:*}"
5 rpath="${2#*:}"
6 lpath="$1"
7 shift 2
9 case "$lpath" in
10 -u) ssh "$rhost" fusermount -u $@ "$rpath"
11 ;;
13 ''|-*) cat <<EOT
14 usage:
15 $0 localpath remotehost:remotepath [-o ro -o allow_other]
16 $0 -u remotehost:remotepath [-z]
17 EOT
18 ;;
20 *) fifo=/tmp/rsshfs-$$
21 ro=""
22 mkfifo $fifo
23 case " $@ " in
24 *\ -o\ ro\ *) ro="-R"
25 esac
26 /usr/sbin/sftp-server $ro <$fifo | \
27 ssh "$rhost" sshfs -o slave ":$lpath" "$rpath" "$@" >$fifo
28 rm -f $fifo
29 esac