Changeset f8fa72b for fedkit/prep_gateway.pl
- Timestamp:
- Mar 5, 2010 3:26:09 AM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 444790d
- Parents:
- c119839
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/prep_gateway.pl
rc119839 rf8fa72b 6 6 7 7 use Getopt::Long; 8 use File::Copy; 9 use IO::File; 8 10 9 11 my $ssh_pubkey; … … 20 22 exit(20) unless GetOptions(%opts); 21 23 22 gateway_lib::read_config(gateway_lib::emulab_config_filename(), \%opts) 23 if $use_file; 24 if ($use_file) { 25 gateway_lib::read_config(gateway_lib::config_filename(), \%opts) 26 } 24 27 25 gateway_lib::set_sshd_params( 26 { 'GatewayPorts' => 'yes', 'PermitTunnel' => 'yes' } ); 27 system("/etc/rc.d/sshd restart"); 28 my $uname = `uname`; 29 chomp $uname; 28 30 29 gateway_lib::import_key($ssh_pubkey,'/root/.ssh/authorized_keys') 30 if $ssh_pubkey; 31 if ($uname =~ /Linux/) { 32 # Right now the only gateway nodes that are Linux nodes are ProtoGENI 33 # nodes. They need a bunch of custom updates to get into the 21st century, 34 # but they are on the network. 35 if ( -x '/usr/local/federation/bin/sshd' && 36 -e '/usr/local/federation/etc/sshd_config') { 37 # Start our modern sshd if one is there 38 system("/usr/local/federation/bin/sshd -p 20200 -f " . 39 "/usr/local/federation/etc/sshd_config"); 40 } 41 # fix yum.conf 42 copy("/etc/yum.conf", "/etc/yum.conf.bak"); 43 my $from = new IO::File("/etc/yum.conf.bak"); 44 my $to = new IO::File(">/etc/yum.conf"); 45 while (<$from>) { 46 s/download.fedoralegacy.org/fedoralegacy.lsu.edu/g; 47 print $to $_; 48 } 49 $from->close(); 50 $to->close(); 51 # Now, bridging 52 system('/usr/bin/yum -y install bridge-utils'); 53 #and keys 54 gateway_lib::import_key($ssh_pubkey,'/root/.ssh/authorized_keys') 55 if $ssh_pubkey; 56 } 57 elsif ($uname =~ /FreeBSD/ ){ 58 gateway_lib::set_sshd_params( 59 { 'GatewayPorts' => 'yes', 'PermitTunnel' => 'yes' } ); 60 system("/etc/rc.d/sshd restart"); 31 61 32 # Need these to make the Ethernet tap and bridge work. 33 system("kldload /boot/kernel/bridgestp.ko") 34 if -r "/boot/kernel/bridgestp.ko"; 35 system("kldload /boot/kernel/if_bridge.ko"); 36 system("kldload /boot/kernel/if_tap.ko"); 62 gateway_lib::import_key($ssh_pubkey,'/root/.ssh/authorized_keys') 63 if $ssh_pubkey; 64 65 # Need these to make the Ethernet tap and bridge work. 66 system("kldload /boot/kernel/bridgestp.ko") 67 if -r "/boot/kernel/bridgestp.ko"; 68 system("kldload /boot/kernel/if_bridge.ko"); 69 system("kldload /boot/kernel/if_tap.ko"); 70 } 37 71 38 72 if ( $tunnelip ) {
Note: See TracChangeset
for help on using the changeset viewer.