Subversion Repositories camp_sysinfo_client_3

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21 rodolico 1
#!/usr/bin/env perl
2
 
3
use warnings;
4
 
5
# special purpose for IPFire routers. NOT a stand alone, used as
6
# a part of install.pl
7
sub systemSpecificInstall {
8
   my @BACKUP_DIRS = ( '/etc/camp' );
9
   `ln -s /opt/camp/sysinfo/sysinfo-client /etc/fcron.daily/sysinfo.cron` if &yesno( 'Add link to fcron.daily' );
10
   # now, check for backup directories not in include.user
11
   open BACKUP, '</var/ipfire/backup/include.user';
12
   while ( $line = <BACKUP> ) {
13
      chomp $line;
14
      for (my $i = 0; $i < @BACKUP_DIRS; $i++ ) {
15
         if ( $BACKUP_DIRS[$i] eq $line ) {
16
            $BACKUP_DIRS[$i] = '';
17
            last;
18
         } # if
19
      }# for
20
   } # while
21
   close BACKUP;
22
 
23
   # if any remain, append them to include.user
24
   open BACKUP, '>>/var/ipfire/backup/include.user';
25
   foreach my $backupDir ( @BACKUP_DIRS ) {
26
      print BACKUP "$backupDir\n" if $backupDir;
27
   }
28
   close BACKUP;
29
 
30
   # set all modules with ipfire or unix in the name to run
31
   my $moduleDir = $moduleDirs[0];
32
   opendir $moduleDir, $moduleDir;
33
   my @modules = grep { /^((ipfire)|(unix))/ } readdir $moduleDir;
34
   closedir $moduleDir;
35
   foreach my $module ( @modules) {
36
      `chmod 0700 $moduleDir/$module`;
37
   }
38
   print "All IPFire specific modules have been enabled\n";
39
}
40
 
41
1;