2 # setup-openssh-keys.pl:
3 # Adapts the installed gsi-ssh environment to the current machine,
4 # performing actions that originally occurred during the package's
5 # 'make install' phase.
7 # Send comments/fixes/suggestions to:
8 # Chase Phillips <cphillip@ncsa.uiuc.edu>
11 $gpath = $ENV{GLOBUS_LOCATION};
14 die "GLOBUS_LOCATION needs to be set before running this script"
18 # i'm including this because other perl scripts in the gpt setup directories
22 @INC = (@INC, "$gpath/lib/perl");
24 require Grid::GPT::Setup;
26 my $globusdir = $gpath;
27 my $setupdir = "$globusdir/setup/globus";
28 my $myname = "setup-openssh-keys.pl";
30 print "$myname: Configuring keys for package 'gsi_openssh'...\n";
33 # Set up path prefixes for use in the path translations
36 $prefix = ${globusdir};
37 $exec_prefix = "${prefix}";
38 $bindir = "${exec_prefix}/bin";
39 $mandir = "${prefix}/man";
41 $libexecdir = "${exec_prefix}/libexec";
42 $sysconfdir = "${prefix}/etc";
44 $xauth_path = "/usr/bin/X11/xauth";
50 print "Generating ssh keys (if necessary)...\n";
51 if ( -e "${sysconfdir}/ssh_host_key" )
53 print "${sysconfdir}/ssh_host_key already exists, skipping.\n";
57 # if $sysconfdir/ssh_host_key doesn't exist..
58 system("$bindir/ssh-keygen -t rsa1 -f $sysconfdir/ssh_host_key -N \"\"");
61 if ( -e "${sysconfdir}/ssh_host_dsa_key" )
63 print "${sysconfdir}/ssh_host_dsa_key already exists, skipping.\n";
67 # if $sysconfdir/ssh_host_dsa_key doesn't exist..
68 system("$bindir/ssh-keygen -t dsa -f $sysconfdir/ssh_host_dsa_key -N \"\"");
71 if ( -e "${sysconfdir}/ssh_host_rsa_key" )
73 print "${sysconfdir}/ssh_host_rsa_key already exists, skipping.\n";
77 # if $sysconfdir/ssh_host_rsa_key doesn't exist..
78 system("$bindir/ssh-keygen -t rsa -f $sysconfdir/ssh_host_rsa_key -N \"\"");
87 my $metadata = new Grid::GPT::Setup(package_name => "gsi_openssh_setup");
91 print "$myname: Finished configuring package 'gsi_openssh'.\n";