Permalink
Browse files

Merge pull request #9 from isync/master

rmount example now accepts a non-standard ssh port; moved a bit of README into POD
  • Loading branch information...
2 parents 7f25045 + 8ce532b commit 06f83d6339117976c4b06a07b0c9027ea716e0c1 @dpavlin committed Jul 18, 2012
Showing with 31 additions and 2 deletions.
  1. +27 −0 Fuse.pm
  2. +4 −2 examples/rmount.pl
View
27 Fuse.pm
@@ -741,6 +741,33 @@ FUSE, so POLLPRI/POLLRDBAND/POLLWRBAND won't work.
Poll handle is currently a read-only scalar; we are investigating a way
to make this an object instead.
+=head1 EXAMPLES
+
+There are a few example scripts in the examples/ subdirectory. These are:
+
+example.pl
+
+ A simple "Hello world" type of script
+
+loopback.pl
+
+ A filesystem loopback-device. like fusexmp from the main FUSE dist,
+ it simply recurses file operations into the real filesystem. Unlike
+ fusexmp, it only re-shares files under the /tmp/test directory.
+
+rmount.pl
+
+ An NFS-workalike which tunnels through SSH. It requires an account
+ on some ssh server (obviously), with public-key authentication enabled.
+ (if you have to type in a password, you don't have this. man ssh_keygen.).
+ Copy rmount_remote.pl to your home directory on the remote machine
+ and make it executable. Then create a mountpoint subdir somewhere local,
+ and run the example script: ./rmount.pl host /remote/dir /local/dir
+
+rmount_remote.pl
+
+ A ripoff of loopback.pl meant to be used as a backend for rmount.pl.
+
=head1 AUTHOR
Mark Glines, E<lt>mark@glines.orgE<gt>
View
@@ -7,14 +7,15 @@
use Fuse;
use Data::Dumper;
+my $port; if($ARGV[-1]=~/^--/){ $port = pop(@ARGV); $port =~ s/--port=//; }
my ($host, $dir, $mount) = @ARGV;
if(!defined($mount)) {
$mount = $dir;
if($host =~ /^(.*):(.*)$/) {
($host,$dir) = ($1,$2);
} else {
- die "usage: $0 user\@host remotedir mountpoint\n".
- "or : $0 user\@host:remotedir mountpoint\n";
+ die "usage: $0 user\@host remotedir mountpoint [--port=<port>]\n".
+ "or : $0 user\@host:remotedir mountpoint [--port=<port>]\n";
}
}
@@ -29,6 +30,7 @@
rmdir mknod statfs);
sub connect_remote {
+ push(@Net::SSH::ssh_options, "-p $port") if $port;
sshopen2($host, *READER, *WRITER, "./rmount_remote.pl $dir")
or die "ssh: $!\n";
select WRITER;

0 comments on commit 06f83d6

Please sign in to comment.