source: fedkit/combo_active.pl @ 2edec46

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
3use strict;
4
5use gateway_lib;
6
7use IO::File;
8
9use Getopt::Long;
10
11my $ssh_pubkey;
12my $ssh_privkey;
13my $tunnelip;
14my $peer;
15my $fedkit_dir= "/usr/local/federation";
16my $perl = "/usr/bin/perl";
17my $iface_file;
18my $ssh = "/usr/bin/ssh";
19my @ports;
20
21exit(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
34my $tunnelparam = $tunnelip ? '--tunnelip' : '';
35my $portparam = join(" --port=", @ports);
36
37# join doesn't prefix the first one
38$portparam="--port=$portparam" if $portparam;
39
40system("$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");
44exit(20) if $?;
45
46system("$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");
50exit(20) if $?;
Note: See TracBrowser for help on using the repository browser.