Subversion Repositories camp_sysinfo_client_3

Rev

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';
11
my $confDir = '/etc/camp';
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`;
24
   `chmod 0700 $targetDir/$dir/*` if $dir eq 'scripts';
25
   `chown root:root $targetDir/$dir/*`;
10 rodolico 26
}
27
 
12 rodolico 28
for $file ( 'sysinfo-client','notes', 'sysinfo-client.conf.template','configure.pl' ) {
13 rodolico 29
   `cp $file $targetDir`;
30
   `chmod 0600 $targetDir/$file`;
31
   `chown root:root $targetDir/$file`;
8 rodolico 32
}
33
 
11 rodolico 34
# Create a link into /usr/local/bin
13 rodolico 35
`chmod 0700 $targetDir/sysinfo-client`;
36
`chmod 0700 $targetDir/configure.pl`;
37
`ln -s $targetDir/sysinfo-client /usr/local/bin/sysinfo-client`;
8 rodolico 38
 
13 rodolico 39
exec( "$thisDir/configure.pl" );
8 rodolico 40
 
41
1;
13 rodolico 42
 
43
 
44
# rm -fRv /opt/camp/sysinfo-client/ /etc/camp/modules/ /etc/camp/scripts/ /usr/local/bin/sysinfo-client