Subversion Repositories camp_sysinfo_client_3

Rev

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

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