wok rev 16759

sshfs-fuse/rsshfs: lazy umount support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jun 16 23:51:49 2014 +0200 (2014-06-16)
parents c176489f467b
children 85a165d936f4
files sshfs-fuse/stuff/rsshfs
line diff
     1.1 --- a/sshfs-fuse/stuff/rsshfs	Mon Jun 16 22:45:42 2014 +0200
     1.2 +++ b/sshfs-fuse/stuff/rsshfs	Mon Jun 16 23:51:49 2014 +0200
     1.3 @@ -1,25 +1,25 @@
     1.4  #!/bin/sh
     1.5 -# from https://github.com/rom1v/rsshfs/blob/master/rsshfs
     1.6 +# from https://github.com/rom1v/rsshfs
     1.7  
     1.8  rhost="${2%%:*}"
     1.9  rpath="${2#*:}"
    1.10  lpath="$1"
    1.11 +shift 2
    1.12  
    1.13 -case "$1" in
    1.14 --u)	ssh "$rhost" fusermount -u "$rpath"
    1.15 +case "$lpath" in
    1.16 +-u)	ssh "$rhost" fusermount -u $@ "$rpath"
    1.17  	;;
    1.18  	
    1.19  ''|-*)	cat <<EOT
    1.20  usage:
    1.21  	$0 localpath remotehost:remotepath [-o ro -o allow_other]
    1.22 -	$0 -u remotehost:remotepath
    1.23 +	$0 -u remotehost:remotepath [-z]
    1.24  EOT
    1.25  	;;
    1.26  	
    1.27 -*)	fifo=/tmp/rsshfs-fifo$$
    1.28 -	shift 2
    1.29 +*)	fifo=/tmp/rsshfs-$$
    1.30  	mkfifo $fifo
    1.31 -	/usr/sbin/sftp-server < $fifo | \
    1.32 +	sftp-server < $fifo | \
    1.33  	ssh "$rhost" sshfs -o slave ":$lpath" "$rpath" "$@" > $fifo
    1.34  	rm -f $fifo
    1.35  esac