Subversion Repositories camp_sysinfo_client_3

Rev

Details | Last modification | View Log | RSS feed

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