Subversion Repositories camp_sysinfo_client_3

Rev

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

Rev 21 Rev 22
Line 3... Line 3...
3
use warnings;
3
use warnings;
4
 
4
 
5
# special purpose for IPFire routers. NOT a stand alone, used as
5
# special purpose for IPFire routers. NOT a stand alone, used as
6
# a part of install.pl
6
# a part of install.pl
7
sub systemSpecificInstall {
7
sub systemSpecificInstall {
-
 
8
   
-
 
9
   if ( -d '/opt/sysinfo'
-
 
10
      && &yesno ('It looks like sysinfo version 2 is installed, should I remove it' ) ) {
-
 
11
      if ( &yesno( 'Back up old configuration? ') ) {
-
 
12
         `tar -czvf /root/sysinfo.2.config.tgz /etc/sysinfo`;
-
 
13
         print "Old configuration copied to /root/sysinfo.2.config.tgz\n";
-
 
14
      }
-
 
15
      `rm -fR /opt/sysinfo`;
-
 
16
      `rm -f /etc/fcron.daily/sysinfo.cron`;
-
 
17
      `cp -av /var/ipfire/backup/include.user /var/ipfire/backup/include.user.bak`;
-
 
18
      `grep -v sysinfo /var/ipfire/backup/include.user.bak > /var/ipfire/backup/include.user`;
-
 
19
   }
-
 
20
   
-
 
21
   
8
   my @BACKUP_DIRS = ( '/etc/camp' );
22
   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' );
23
   `ln -s /opt/camp/sysinfo-client/sysinfo-client /etc/fcron.daily/sysinfo.cron`
-
 
24
      if &yesno( 'Add link to fcron.daily' );
10
   # now, check for backup directories not in include.user
25
   # now, check for backup directories not in include.user
11
   open BACKUP, '</var/ipfire/backup/include.user';
26
   open BACKUP, '</var/ipfire/backup/include.user';
12
   while ( $line = <BACKUP> ) {
27
   while ( $line = <BACKUP> ) {
13
      chomp $line;
28
      chomp $line;
14
      for (my $i = 0; $i < @BACKUP_DIRS; $i++ ) {
29
      for (my $i = 0; $i < @BACKUP_DIRS; $i++ ) {