Subversion Repositories camp_sysinfo_client_3

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
16 rodolico 1
#!/usr/bin/env perl
8 rodolico 2
 
16 rodolico 3
use warnings;
4
 
13 rodolico 5
my $thisDir = `pwd`;
6
chomp $thisDir;
7
 
8
my $targetDir = '/opt/camp/sysinfo-client';
9
my $modulesDir = $targetDir . '/modules';
10
my $scriptsDir = $targetDir . '/scripts';
18 rodolico 11
my $confDir = '/etc/camp/sysinfo-client';
13 rodolico 12
 
11 rodolico 13
# an extremely basic installer for sysinfo-client
9 rodolico 14
 
13 rodolico 15
for $dir ( $targetDir, $modulesDir, $scriptsDir, $confDir, $confDir . '/modules', $confDir . '/scripts' ) {
16
   next if -d $dir;
11 rodolico 17
   `mkdir -p $dir`;
18
   `chmod 0700 $dir`;
19
   `chown root:root $dir`;
10 rodolico 20
}
8 rodolico 21
 
11 rodolico 22
for $dir ( 'modules', 'scripts' ) {
13 rodolico 23
   `cp -av $dir $targetDir`;
18 rodolico 24
   `rm -fR $targetDir/$dir/.svn`;
25
   `chmod 0700 $targetDir/$dir`;
26
   if ( $dir eq 'scripts' ) {
27
      `chmod -fR 0700 $targetDir/$dir/*`;
28
   } else {
29
      `chmod -fR 0600 $targetDir/$dir/*`;
30
   }
31
   `chown -fR root:root $targetDir/$dir`;
10 rodolico 32
}
33
 
18 rodolico 34
for $file ( 'sysinfo-client','notes', 'sysinfo-client.conf.template','configure.pl', 'uninstall.pl' ) {
13 rodolico 35
   `cp $file $targetDir`;
36
   `chmod 0600 $targetDir/$file`;
37
   `chown root:root $targetDir/$file`;
8 rodolico 38
}
39
 
18 rodolico 40
# Set permissions
13 rodolico 41
`chmod 0700 $targetDir/sysinfo-client`;
42
`chmod 0700 $targetDir/configure.pl`;
18 rodolico 43
`chmod 0700 $targetDir/uninstall.pl`;
8 rodolico 44
 
13 rodolico 45
exec( "$thisDir/configure.pl" );
8 rodolico 46
 
13 rodolico 47
 
48
 
49
# rm -fRv /opt/camp/sysinfo-client/ /etc/camp/modules/ /etc/camp/scripts/ /usr/local/bin/sysinfo-client