Subversion Repositories camp_sysinfo_client_3

Rev

Rev 16 | Blame | Last modification | View Log | RSS feed

#!/usr/bin/env perl

use warnings;

my $thisDir = `pwd`;
chomp $thisDir;

my $targetDir = '/opt/camp/sysinfo-client';
my $modulesDir = $targetDir . '/modules';
my $scriptsDir = $targetDir . '/scripts';
my $confDir = '/etc/camp/sysinfo-client';

# an extremely basic installer for sysinfo-client

for $dir ( $targetDir, $modulesDir, $scriptsDir, $confDir, $confDir . '/modules', $confDir . '/scripts' ) {
   next if -d $dir;
   `mkdir -p $dir`;
   `chmod 0700 $dir`;
   `chown root:root $dir`;
}

for $dir ( 'modules', 'scripts' ) {
   `cp -av $dir $targetDir`;
   `rm -fR $targetDir/$dir/.svn`;
   `chmod 0700 $targetDir/$dir`;
   if ( $dir eq 'scripts' ) {
      `chmod -fR 0700 $targetDir/$dir/*`;
   } else {
      `chmod -fR 0600 $targetDir/$dir/*`;
   }
   `chown -fR root:root $targetDir/$dir`;
}

for $file ( 'sysinfo-client','notes', 'sysinfo-client.conf.template','configure.pl', 'uninstall.pl' ) {
   `cp $file $targetDir`;
   `chmod 0600 $targetDir/$file`;
   `chown root:root $targetDir/$file`;
}

# Set permissions
`chmod 0700 $targetDir/sysinfo-client`;
`chmod 0700 $targetDir/configure.pl`;
`chmod 0700 $targetDir/uninstall.pl`;

exec( "$thisDir/configure.pl" );



# rm -fRv /opt/camp/sysinfo-client/ /etc/camp/modules/ /etc/camp/scripts/ /usr/local/bin/sysinfo-client

Generated by GNU Enscript 1.6.5.90.