Created
March 1, 2009 10:58
-
-
Save miyagawa/72301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use URI; | |
my $mms = shift @ARGV or die "Usage: mms-ssh-proxy-open.pl MMSURL [time]\n"; | |
my $time = shift @ARGV || 3600; | |
my $uri = URI->new($mms); | |
my $ssh_host = $ENV{SSH_HOST} || shift @ARGV or die "SSH_HOST not defined\n"; | |
my $mms_host = $uri->host; | |
$uri->host("localhost"); | |
system "ssh -f -L 1755:$mms_host:1755 $ssh_host 'sleep $time'"; | |
system "open $uri"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment