Subversion Repositories camp_sysinfo_client_3

Rev

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

Rev 118 Rev 120
Line 47... Line 47...
47
 
47
 
48
my $status; # exit status of the processes
48
my $status; # exit status of the processes
49
my $sourceDir = File::Spec->catdir($FindBin::Bin);
49
my $sourceDir = File::Spec->catdir($FindBin::Bin);
50
my $installType;
50
my $installType;
51
 
51
 
-
 
52
my @messages; # stores any messages we want to show up at the end
-
 
53
my @feedback; # store feedback when we execute command line actions
52
 
54
 
53
my %install = (  'bindir' => '/opt/camp/sysinfo-client',
55
my %install = (  'bindir' => '/opt/camp/sysinfo-client',
54
                 'confdir' => '/etc/camp/sysinfo-client',
56
                 'confdir' => '/etc/camp/sysinfo-client',
55
                 'application name' => 'sysinfo client',
57
                 'application name' => 'sysinfo client',
56
                 'default group' => 'root',
58
                 'default group' => 'root',
Line 181... Line 183...
181
                                    'type' => 'file',
183
                                    'type' => 'file',
182
                                    'permission' => '444',
184
                                    'permission' => '444',
183
                                    'owner' => '<default owner>:<default group>',
185
                                    'owner' => '<default owner>:<default group>',
184
                                    'target' =>  '<bindir>/YAML'
186
                                    'target' =>  '<bindir>/YAML'
185
                                 },
187
                                 },
-
 
188
                              'actions_sysinfo.conf' => {
-
 
189
                                    'type' => 'file',
-
 
190
                                    'permission' => '755',
-
 
191
                                    'owner' => '<default owner>:<default group>',
-
 
192
                                    'target' => '/usr/local/opnsense/service/conf/actions.d',
-
 
193
                                    'post action' => 'service configd restart',
-
 
194
                                    'message' => 'No automatic run can be done. Please log in through the webui and enable the sysinfo cron job'
-
 
195
                                 },
186
                              },
196
                              },
187
                 },
197
                 },
188
                  
198
                  
189
                );
199
                );
190
 
200
 
Line 414... Line 424...
414
      &runCommand( 
424
      &runCommand( 
415
            "cp $$fileList{$file}{'source'} $$fileList{$file}{'target'}",
425
            "cp $$fileList{$file}{'source'} $$fileList{$file}{'target'}",
416
            "chmod $$fileList{$file}{'permission'} $$fileList{$file}{'target'}",
426
            "chmod $$fileList{$file}{'permission'} $$fileList{$file}{'target'}",
417
            "chown  $$fileList{$file}{'owner'} $$fileList{$file}{'target'}"
427
            "chown  $$fileList{$file}{'owner'} $$fileList{$file}{'target'}"
418
            );
428
            );
-
 
429
            # if there is a post action, run it and store any return in @feedback
-
 
430
            push @feedback, `$fileList->{$file}->{'post action'}` if defined $fileList->{$file}->{'post action'};
-
 
431
            # if there is a message to be passed, store it in @messages
-
 
432
            push @messages, $fileList->{$file}->{'meesage'} if defined $fileList->{$file}->{'message'};
419
   } # foreach file
433
   } # foreach file
420
   return 1;
434
   return 1;
421
}
435
}
422
 
436
 
423
sub postInstall {
437
sub postInstall {
Line 458... Line 472...
458
      my $content = &showConf( $config );
472
      my $content = &showConf( $config );
459
      print $content;
473
      print $content;
460
      print &writeConfig( $$install{'configuration'}{'configuration file'} , $content ) . "\n"
474
      print &writeConfig( $$install{'configuration'}{'configuration file'} , $content ) . "\n"
461
         if ( &yesno( "Write the above configuration to $$install{'configuration'}{'configuration file'}?" ) );
475
         if ( &yesno( "Write the above configuration to $$install{'configuration'}{'configuration file'}?" ) );
462
   } # if we are building/merging configuration
476
   } # if we are building/merging configuration
-
 
477
   if ( @feedback ) {
-
 
478
      print "We got some messages while doing the install, please review below\n" . join( "\n", @feedback ) . "\n";
463
   
479
   }
-
 
480
   if ( @messages ) {
-
 
481
      print "\n\nFollowing are some important messages for your installation\n" . join( "\n", @messages ) . "\n";
-
 
482
   }
464
}
483
}
465
 
484
 
466
sub help {
485
sub help {
467
   my $oses = join( ' ', keys %operatingSystems );
486
   my $oses = join( ' ', keys %operatingSystems );
468
   print <<END
487
   print <<END