Subversion Repositories camp_sysinfo_client_3

Rev

Rev 230 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 230 Rev 242
Line 20... Line 20...
20
our $DEBUG;
20
our $DEBUG;
21
# $DEBUG = 1;
21
# $DEBUG = 1;
22
 
22
 
23
my $scriptDir = abs_path(File::Spec->catdir($FindBin::Bin) );
23
my $scriptDir = abs_path(File::Spec->catdir($FindBin::Bin) );
24
my $binDir = abs_path("$scriptDir/../"); # bin directory assumed to be above this one
24
my $binDir = abs_path("$scriptDir/../"); # bin directory assumed to be above this one
-
 
25
my $runPeriodicFlag = 'touch /tmp/sysinfo.firstrun'; # this is a flag that says to go ahead and run periodic scripts
25
 
26
 
26
sub checkDirectory {
27
sub checkDirectory {
27
   my $directory = shift;
28
   my $directory = shift;
28
   print "In checkDirectory, looking in $directory\n";
29
   print "In checkDirectory, looking in $directory\n";
29
   my @dirs;
30
   my @dirs;
Line 36... Line 37...
36
   #die "dirs is " . join("\n", @dirs ) . "\n";
37
   #die "dirs is " . join("\n", @dirs ) . "\n";
37
   while ( my $script = shift(@dirs) ) {
38
   while ( my $script = shift(@dirs) ) {
38
      next if $script =~ /\..+$/; # ignore anything with a period in it
39
      next if $script =~ /\..+$/; # ignore anything with a period in it
39
      next if $script =~ /README/; # ignore readme
40
      next if $script =~ /README/; # ignore readme
40
      print "Checking $directory/$script\n";
41
      print "Checking $directory/$script\n";
-
 
42
      &runCommand( $runPeriodicFlag ); # ensure we will attempt to run all periodic scripts also
41
      &runCommand( "chmod 755 $directory/$script" );
43
      &runCommand( "chmod 755 $directory/$script" );
42
      my $output = `$directory/$script $directory`;
44
      my $output = `$directory/$script $directory`;
43
      my $mod = $output ? '700' : '600';
45
      my $mod = $output ? '700' : '600';
44
      &runCommand( "chmod $mod $directory/$script" );
46
      &runCommand( "chmod $mod $directory/$script" );
45
   }
47
   }