X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/5002372c6dedf37f56bae9100e6159454a0efa0e..a26c150d10222b30b120ab6a99d1949aa17393e9:/setup/setup-openssh.pl?ds=sidebyside diff --git a/setup/setup-openssh.pl b/setup/setup-openssh.pl index 05d3936..d703bf3 100644 --- a/setup/setup-openssh.pl +++ b/setup/setup-openssh.pl @@ -331,6 +331,65 @@ sub fixpaths return 0; } +sub fixGlobusLocation +{ + $data = readFile($initfile); + $data =~ s|@GLOBUS_LOCATION@|$gpath|g; + writeFile($data); +} + +### readFile( $filename ) +# +# reads and returns $filename's contents +# + +sub readFile +{ + my ($filename) = @_; + my $data; + + open (IN, "$filename") || die "Can't open '$filename': $!"; + $/ = undef; + $data = ; + $/ = "\n"; + close(IN); + + return $data; +} + +### writeFile( $filename, $fileinput ) +# +# create the inputs to the ssl program at $filename, appending the common name to the +# stream in the process +# + +sub writeFile +{ + my ($filename, $fileinput) = @_; + + # + # test for a valid $filename + # + + if ( !defined($filename) || (length($filename) lt 1) ) + { + die "Filename is undefined"; + } + + if ( ( -e "$filename" ) && ( ! -w "$filename" ) ) + { + die "Cannot write to filename '$filename'"; + } + + # + # write the output to $filename + # + + open(OUT, ">$filename"); + print OUT "$fileinput"; + close(OUT); +} + print "---------------------------------------------------------------\n"; print "Hi, I'm the setup script for the gsi_openssh package! There\n"; print "are some last minute details that I've got to set straight\n";