Ignore:
Timestamp:
Oct 13, 2007, 4:25:50 AM (17 years ago)
Author:
quentin
Message:
mediawiki 1.11 installer + improvements to installer system
File:
1 edited

Legend:

Unmodified
Added
Removed
  • locker/deploy/bin/onserver.pm

    r240 r456  
    22use strict;
    33use Exporter;
     4use Sys::Hostname;
     5use File::Spec::Functions;
     6use File::Basename;
     7use Socket;
     8use Cwd qw(abs_path);
     9use POSIX qw(strftime);
    410our @ISA = qw(Exporter);
    511our @EXPORT = qw(setup totmp print_login_info press_enter $server $tmp $USER $HOME $sname $deploy $addrend $admin_username $requires_sql $addrlast $sqlhost $sqluser $sqlpass $sqldb $sqldbcurl $admin_password $scriptsdev $human);
     
    2026  print "  username: $admin_username\n";
    2127  print "  password: $admin_password\n";
     28}
     29
     30sub getclienthostname {
     31    if (my $sshclient = $ENV{"SSH_CLIENT"}) {
     32        my ($clientip) = split(' ', $sshclient);
     33        my $hostname = gethostbyaddr(inet_aton($clientip), AF_INET);
     34        return $hostname || $clientip;
     35    } else {
     36        return hostname();
     37    }
    2238}
    2339
     
    7187  print "\nConfiguring $sname...\n";
    7288 
    73   `date > .scripts-version`;
    74   `stat /mit/scripts/deploy$scriptsdev/$deploy.tar.gz >> .scripts-version`;
     89  open(VERSION, ">.scripts-version") or die "Can't write scripts-version file: $!\n";
     90  print VERSION strftime("%F %T %z\n", localtime);
     91  print VERSION $ENV{'USER'}, '@', getclienthostname(), "\n";
     92  my $tarball = abs_path("/mit/scripts/deploy$scriptsdev/$deploy.tar.gz");
     93  print VERSION $tarball, "\n";
     94  $tarball =~ s|/deploydev/|/deploy/|;
     95  print VERSION dirname($tarball), "\n";
     96  close(VERSION);
     97  if (0) {
     98      `date > .scripts-version`;
     99      `stat /mit/scripts/deploy$scriptsdev/$deploy.tar.gz >> .scripts-version`;
     100  }
    75101
    76102  select STDOUT;
Note: See TracChangeset for help on using the changeset viewer.