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
# some debian specific things. NOT a stand alone; loaded by install.pl
6
sub systemSpecificInstall {
7
   if ( &yesno( 'Add link to cron.daily' ) ) {
8
      `rm /etc/cron.daily/sysinfo` if -e '/etc/cron.daily/sysinfo';
9
      `ln -s /opt/camp/sysinfo-client/sysinfo-client /etc/cron.daily/sysinfo`;
10
   }
11
   if ( `dpkg --get-selections | grep  sysinfo-client | grep install` 
12
      && &yesno ('It looks like sysinfo version 2 is installed via apt, should I remove it' ) ) {
13
      if ( &yesno( 'Back up old configuration? ') ) {
14
         `tar -czvf /root/sysinfo.2.config.tgz /etc/sysinfo`;
15
         print "Old configuration copied to /root/sysinfo.2.config.tgz\n";
16
      }
23 rodolico 17
      system 'apt-get -y --purge remove sysinfo-client';
21 rodolico 18
      print "There may be some unused packages now. You can remove them with\napt-get autoremove\n\n";
19
   }
20
   if ( &yesno( 'Would you like a link to /usr/local/bin/sysinfo-client' ) ) {
21
      `rm /usr/local/bin/sysinfo-client` if -e '/usr/local/bin/sysinfo-client';
22
      `ln -s  /opt/camp/sysinfo/sysinfo-client /usr/local/bin/sysinfo-client`;
23
   }
24
 
25
   # set all modules with debian or unix in the name to run
26
   foreach my $directory ( @moduleDirs ) {
27
      opendir ( $dh, $directory ) or die "Could not open directory [$directory]\n";
28
      my @modules = grep { /^((dpkg)|(unix))/ } readdir $dh;
29
      closedir $dh;
30
      foreach my $module (@modules) {
31
         `chmod 0700 $directory/$module`;
32
         `chown root:root $directory/$module`;
33
      }
34
   }
35
   print "All debian specific modules have been enabled\n";
36
}
37
 
38
1;