Subversion Repositories camp_sysinfo_client_3

Rev

Rev 16 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16 Rev 18
Line 6... Line 6...
6
chomp $thisDir;
6
chomp $thisDir;
7
 
7
 
8
my $targetDir = '/opt/camp/sysinfo-client';
8
my $targetDir = '/opt/camp/sysinfo-client';
9
my $modulesDir = $targetDir . '/modules';
9
my $modulesDir = $targetDir . '/modules';
10
my $scriptsDir = $targetDir . '/scripts';
10
my $scriptsDir = $targetDir . '/scripts';
11
my $confDir = '/etc/camp';
11
my $confDir = '/etc/camp/sysinfo-client';
12
 
12
 
13
# an extremely basic installer for sysinfo-client
13
# an extremely basic installer for sysinfo-client
14
 
14
 
15
for $dir ( $targetDir, $modulesDir, $scriptsDir, $confDir, $confDir . '/modules', $confDir . '/scripts' ) {
15
for $dir ( $targetDir, $modulesDir, $scriptsDir, $confDir, $confDir . '/modules', $confDir . '/scripts' ) {
16
   next if -d $dir;
16
   next if -d $dir;
Line 19... Line 19...
19
   `chown root:root $dir`;
19
   `chown root:root $dir`;
20
}
20
}
21
 
21
 
22
for $dir ( 'modules', 'scripts' ) {
22
for $dir ( 'modules', 'scripts' ) {
23
   `cp -av $dir $targetDir`;
23
   `cp -av $dir $targetDir`;
-
 
24
   `rm -fR $targetDir/$dir/.svn`;
24
   `chmod 0700 $targetDir/$dir/*` if $dir eq 'scripts';
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
   }
25
   `chown root:root $targetDir/$dir/*`;
31
   `chown -fR root:root $targetDir/$dir`;
26
}
32
}
27
 
33
 
28
for $file ( 'sysinfo-client','notes', 'sysinfo-client.conf.template','configure.pl' ) {
34
for $file ( 'sysinfo-client','notes', 'sysinfo-client.conf.template','configure.pl', 'uninstall.pl' ) {
29
   `cp $file $targetDir`;
35
   `cp $file $targetDir`;
30
   `chmod 0600 $targetDir/$file`;
36
   `chmod 0600 $targetDir/$file`;
31
   `chown root:root $targetDir/$file`;
37
   `chown root:root $targetDir/$file`;
32
}
38
}
33
 
39
 
34
# Create a link into /usr/local/bin
40
# Set permissions
35
`chmod 0700 $targetDir/sysinfo-client`;
41
`chmod 0700 $targetDir/sysinfo-client`;
36
`chmod 0700 $targetDir/configure.pl`;
42
`chmod 0700 $targetDir/configure.pl`;
37
`ln -s $targetDir/sysinfo-client /usr/local/bin/sysinfo-client`;
43
`chmod 0700 $targetDir/uninstall.pl`;
38
 
44
 
39
exec( "$thisDir/configure.pl" );
45
exec( "$thisDir/configure.pl" );
40
 
46
 
41
1;
-
 
42
 
47
 
43
 
48
 
44
# rm -fRv /opt/camp/sysinfo-client/ /etc/camp/modules/ /etc/camp/scripts/ /usr/local/bin/sysinfo-client
49
# rm -fRv /opt/camp/sysinfo-client/ /etc/camp/modules/ /etc/camp/scripts/ /usr/local/bin/sysinfo-client