Subversion Repositories sysadmin_scripts

Rev

Rev 59 | Rev 62 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59 Rev 60
Line 1... Line 1...
1
#! /usr/bin/perl -w
1
#! /usr/bin/perl -w
2
 
2
 
3
use Cwd;
3
use Cwd;
-
 
4
use File::Copy;
4
 
5
 
5
my $dir = getcwd; # remember where we downloaded this to
6
my $dir = getcwd; # remember where we downloaded this to
6
 
7
 
-
 
8
my $installDir = shift;
-
 
9
$installDir = '/opt' unless $installDir;
-
 
10
 
7
 
11
 
8
# get files from server
12
# get files from server
9
`wget -q http://clara.dailydata.net:22080/uploadFiles299q/sendEmail/sendEmail.tgz`;
13
#`wget -q http://clara.dailydata.net:22080/uploadFiles299q/sendEmail/sendEmail.tgz`;
10
 
14
 
11
# Add sendEmail to server
15
# Add sendEmail to server
12
if ( -d '/opt/sendEmail' ) {
16
$installDir .= '/sendEmail';
-
 
17
`mkdir -p $installDir`;
13
   warn "/opt/sendEmail exists, moving it to /opt/sendEmail.old\n";
18
copy( 'sendEmail.pl', "$installDir/sendEmail.pl" );
14
   `mv /opt/sendEmail /opt/sendEmail.old`;
19
copy( 'sendmail2sendEmail.pl', "$installDir/sendmail2sendEmail.pl" );
15
}
-
 
16
 
-
 
17
chdir('/opt');
-
 
18
`tar -xzvf /$dir/sendEmail.tgz`;
20
`ln -s $installDir/sendEmail.pl $installDir/sendEmail`;
19
`chown -fRv root:root /opt/sendEmail`;
21
`chown -fRv root:root $installDir`;
20
`chmod 755 /opt/sendEmail/*`;
22
`chmod 755 $installDir/*`;
21
`ln -s /opt/sendEmail/sendEmail.pl /opt/sendEmail/sendEmail`;
-
 
22
 
23
 
23
chdir $dir;
24
print '1.56';
24
print "We are done and ready for testing\n";
-
 
-
 
25
1;