]> andersk Git - gssapi-openssh.git/commitdiff
o Add files to gsi-openssh for generating keys into /etc. Needs work.
authorcphillip <cphillip>
Tue, 22 Jan 2002 16:01:20 +0000 (16:01 +0000)
committercphillip <cphillip>
Tue, 22 Jan 2002 16:01:20 +0000 (16:01 +0000)
setup/setup-openssh-keys [new file with mode: 0644]
setup/setup-openssh-keys.pl [new file with mode: 0644]

diff --git a/setup/setup-openssh-keys b/setup/setup-openssh-keys
new file mode 100644 (file)
index 0000000..b36b261
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+if [ "$GLOBUS_LOCATION" = "" ]; then
+  echo "Set GLOBUS_LOCATION before running this script"
+  exit 1
+fi
+
+perl $GLOBUS_LOCATION/setup/globus/setup-openssh-keys.pl
diff --git a/setup/setup-openssh-keys.pl b/setup/setup-openssh-keys.pl
new file mode 100644 (file)
index 0000000..c38b462
--- /dev/null
@@ -0,0 +1,91 @@
+#
+# setup-openssh-keys.pl:
+#   Adapts the installed gsi-ssh environment to the current machine,
+#   performing actions that originally occurred during the package's
+#   'make install' phase.
+#
+# Send comments/fixes/suggestions to:
+# Chase Phillips <cphillip@ncsa.uiuc.edu>
+#
+
+$gpath = $ENV{GLOBUS_LOCATION};
+if (!defined($gpath))
+{
+    die "GLOBUS_LOCATION needs to be set before running this script"
+}
+
+#
+# i'm including this because other perl scripts in the gpt setup directories
+# do so
+#
+
+@INC = (@INC, "$gpath/lib/perl");
+
+require Grid::GPT::Setup;
+
+my $globusdir = $gpath;
+my $setupdir = "$globusdir/setup/globus";
+my $myname = "setup-openssh-keys.pl";
+
+print "$myname: Configuring keys for package 'gsi_openssh'...\n";
+
+#
+# Set up path prefixes for use in the path translations
+#
+
+$prefix = ${globusdir};
+$exec_prefix = "${prefix}";
+$bindir = "${exec_prefix}/bin";
+$mandir = "${prefix}/man";
+$mansubdir = "man";
+$libexecdir = "${exec_prefix}/libexec";
+$sysconfdir = "${prefix}/etc";
+$piddir = "/var/run";
+$xauth_path = "/usr/bin/X11/xauth";
+
+$sysconfdir = "/etc";
+
+sub runkeygen
+{
+    print "Generating ssh keys (if necessary)...\n";
+    if ( -e "${sysconfdir}/ssh_host_key" )
+    {
+        print "${sysconfdir}/ssh_host_key already exists, skipping.\n";
+    }
+    else
+    {
+        # if $sysconfdir/ssh_host_key doesn't exist..
+        system("$bindir/ssh-keygen -t rsa1 -f $sysconfdir/ssh_host_key -N \"\"");
+    }
+
+    if ( -e "${sysconfdir}/ssh_host_dsa_key" )
+    {
+        print "${sysconfdir}/ssh_host_dsa_key already exists, skipping.\n";
+    }
+    else
+    {
+        # if $sysconfdir/ssh_host_dsa_key doesn't exist..
+        system("$bindir/ssh-keygen -t dsa -f $sysconfdir/ssh_host_dsa_key -N \"\"");
+    }
+
+    if ( -e "${sysconfdir}/ssh_host_rsa_key" )
+    {
+        print "${sysconfdir}/ssh_host_rsa_key already exists, skipping.\n";
+    }
+    else
+    {
+        # if $sysconfdir/ssh_host_rsa_key doesn't exist..
+        system("$bindir/ssh-keygen -t rsa -f $sysconfdir/ssh_host_rsa_key -N \"\"");
+    }
+
+    return 0;
+}
+
+fixpaths();
+runkeygen();
+
+my $metadata = new Grid::GPT::Setup(package_name => "gsi_openssh_setup");
+
+$metadata->finish();
+
+print "$myname: Finished configuring package 'gsi_openssh'.\n";
This page took 0.050182 seconds and 5 git commands to generate.