Permalink
Browse files

examples/rmount.pl now accepts a non-standard ssh port

  • Loading branch information...
1 parent 7f25045 commit 9c02bbc70b4a0fab71fb50061450c5a9bba4cf46 @isync isync committed Jul 16, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 examples/rmount.pl
View
6 examples/rmount.pl
@@ -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 9c02bbc

Please sign in to comment.