Subversion Repositories camp_sysinfo_client_3

Rev

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

Rev 242 Rev 249
Line 16... Line 16...
16
 
16
 
17
use Cwd qw(abs_path);
17
use Cwd qw(abs_path);
18
use sysinfosetup;
18
use sysinfosetup;
19
 
19
 
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
my $runPeriodicFlag = 'touch /tmp/sysinfo.firstrun'; # this is a flag that says to go ahead and run periodic scripts
26
 
26
 
Line 47... Line 47...
47
   }
47
   }
48
}
48
}
49
 
49
 
50
# setting permissions
50
# setting permissions
51
 
51
 
-
 
52
my %su = ( 
-
 
53
   'debian' => 'root:root',
-
 
54
   'freebsd' => 'root:wheel',
-
 
55
   'opnsense' => 'root:wheel'
-
 
56
   );
-
 
57
 
-
 
58
my $os = `./determineOS`;
-
 
59
 
-
 
60
my $owner = $su{$os} ? $su{$os} : 'root:root';
52
&runCommand( "chown -fR root:root $binDir" );
61
&runCommand( "chown -fR $owner $binDir" );
53
&runCommand( "chmod 700 $binDir/sysinfo-client" );
62
&runCommand( "chmod 700 $binDir/sysinfo-client" );
54
&runCommand( "chmod 700 $binDir/configure" );
63
&runCommand( "chmod 700 $binDir/configure" );
55
 
64
 
56
&checkDirectory( "$binDir/modules" );
65
&checkDirectory( "$binDir/modules" );