axis_examplecompt_changesinfo-opsversion-3.01version-3.02
Last change
on this file since 2edec46 was
2edec46,
checked in by Ted Faber <faber@…>, 15 years ago
|
Factored gateway implementation. Initial import.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | use strict; |
---|
4 | |
---|
5 | use gateway_lib; |
---|
6 | |
---|
7 | use IO::File; |
---|
8 | |
---|
9 | use Getopt::Long; |
---|
10 | |
---|
11 | my $ssh_pubkey; |
---|
12 | my $ssh_privkey; |
---|
13 | my $tunnelip; |
---|
14 | my $peer; |
---|
15 | my $fedkit_dir= "/usr/local/federation"; |
---|
16 | my $perl = "/usr/bin/perl"; |
---|
17 | my $iface_file; |
---|
18 | my $ssh = "/usr/bin/ssh"; |
---|
19 | my @ports; |
---|
20 | |
---|
21 | exit(20) unless GetOptions( |
---|
22 | 'ssh_pubkey=s' => \$ssh_pubkey, |
---|
23 | 'ssh_privkey=s' => \$ssh_privkey, |
---|
24 | 'tunnelip' => \$tunnelip, |
---|
25 | 'peer=s' => \$peer, |
---|
26 | 'fedkit=s' => \$fedkit_dir, |
---|
27 | 'perl=s' => \$perl, |
---|
28 | 'interfaces=s' => \$iface_file, |
---|
29 | 'ssh=s' => \$ssh, |
---|
30 | 'port=s', \@ports, |
---|
31 | ); |
---|
32 | |
---|
33 | |
---|
34 | my $tunnelparam = $tunnelip ? '--tunnelip' : ''; |
---|
35 | my $portparam = join(" --port=", @ports); |
---|
36 | |
---|
37 | # join doesn't prefix the first one |
---|
38 | $portparam="--port=$portparam" if $portparam; |
---|
39 | |
---|
40 | system("$perl -I$fedkit_dir/lib $fedkit_dir/bin/active_config.pl " . |
---|
41 | "--peer=$peer --ssh_pubkey=$ssh_pubkey --ssh_privkey=$ssh_privkey " . |
---|
42 | " $tunnelparam --fedkit=$fedkit_dir --perl=$perl " . |
---|
43 | "--ssh=$ssh --interfaces=$iface_file"); |
---|
44 | exit(20) if $?; |
---|
45 | |
---|
46 | system("$perl -I$fedkit_dir/lib $fedkit_dir/bin/port_forward.pl " . |
---|
47 | "--peer=$peer --ssh_pubkey=$ssh_pubkey --ssh_privkey=$ssh_privkey " . |
---|
48 | " $tunnelparam --fedkit=$fedkit_dir --perl=$perl " . |
---|
49 | "--ssh=$ssh $portparam"); |
---|
50 | exit(20) if $?; |
---|
Note: See
TracBrowser
for help on using the repository browser.