Changeset 456 for locker/deploy/bin/onserver.pm
- Timestamp:
- Oct 13, 2007, 4:25:50 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
locker/deploy/bin/onserver.pm
r240 r456 2 2 use strict; 3 3 use Exporter; 4 use Sys::Hostname; 5 use File::Spec::Functions; 6 use File::Basename; 7 use Socket; 8 use Cwd qw(abs_path); 9 use POSIX qw(strftime); 4 10 our @ISA = qw(Exporter); 5 11 our @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); … … 20 26 print " username: $admin_username\n"; 21 27 print " password: $admin_password\n"; 28 } 29 30 sub 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 } 22 38 } 23 39 … … 71 87 print "\nConfiguring $sname...\n"; 72 88 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 } 75 101 76 102 select STDOUT;
Note: See TracChangeset
for help on using the changeset viewer.