| Line 140... |
Line 140... |
| 140 |
);
|
140 |
);
|
| 141 |
|
141 |
|
| 142 |
# hash to set up os specific rules
|
142 |
# hash to set up os specific rules
|
| 143 |
my %operatingSystems = (
|
143 |
my %operatingSystems = (
|
| 144 |
'debian' => {
|
144 |
'debian' => {
|
| - |
|
145 |
'regex' = '(debian|mx)',
|
| 145 |
'bindir' => '/opt/camp/sysinfo-client',
|
146 |
'bindir' => '/opt/camp/sysinfo-client',
|
| 146 |
'confdir' => '/etc/camp/sysinfo-client',
|
147 |
'confdir' => '/etc/camp/sysinfo-client',
|
| 147 |
'crontab' => 'ln -s <bindir>/sysinfo-client /etc/cron.daily/sysinfo-client',
|
148 |
'crontab' => 'ln -s <bindir>/sysinfo-client /etc/cron.daily/sysinfo-client',
|
| 148 |
'modules' => '((linux)|(dpkg)|(unix)|(all))',
|
149 |
'modules' => '((linux)|(dpkg)|(unix)|(all))',
|
| 149 |
},
|
150 |
},
|
| 150 |
'ipfire' => {
|
151 |
'ipfire' => {
|
| - |
|
152 |
'regex' => 'ipfire',
|
| 151 |
'bindir' => '/opt/camp/sysinfo-client',
|
153 |
'bindir' => '/opt/camp/sysinfo-client',
|
| 152 |
'confdir' => '/etc/camp/sysinfo-client',
|
154 |
'confdir' => '/etc/camp/sysinfo-client',
|
| 153 |
'crontab' => 'ln -s <bindir>/sysinfo-client /etc/fcron.daily/sysinfo-client.fcron',
|
155 |
'crontab' => 'ln -s <bindir>/sysinfo-client /etc/fcron.daily/sysinfo-client.fcron',
|
| 154 |
'modules' => '((ipfire)|(unix)|(all))',
|
156 |
'modules' => '((ipfire)|(unix)|(all))',
|
| 155 |
},
|
157 |
},
|
| 156 |
'freebsd' => {
|
158 |
'freebsd' => {
|
| - |
|
159 |
'regex' => 'freebsd',
|
| 157 |
'bindir' => '/usr/local/opt/camp/sysinfo-client',
|
160 |
'bindir' => '/usr/local/opt/camp/sysinfo-client',
|
| 158 |
'confdir' => '/usr/local/etc/camp/sysinfo-client',
|
161 |
'confdir' => '/usr/local/etc/camp/sysinfo-client',
|
| 159 |
'crontab' => 'ln -s <bindir>/sysinfo-client /etc/periodic/daily/sysinfo-client',
|
162 |
'crontab' => 'ln -s <bindir>/sysinfo-client /etc/periodic/daily/sysinfo-client',
|
| 160 |
'modules' => '((bsd)|(unix)|(all))',
|
163 |
'modules' => '((bsd)|(unix)|(all))',
|
| 161 |
'default group' => 'wheel',
|
164 |
'default group' => 'wheel',
|
| Line 224... |
Line 227... |
| 224 |
my ( $install, $operatingSystems, $os ) = @_;
|
227 |
my ( $install, $operatingSystems, $os ) = @_;
|
| 225 |
if ( ! $os ) { # we don't know, so we must try to figure it out
|
228 |
if ( ! $os ) { # we don't know, so we must try to figure it out
|
| 226 |
my $osString = `uname -a`;
|
229 |
my $osString = `uname -a`;
|
| 227 |
foreach my $osType ( keys %$operatingSystems ) {
|
230 |
foreach my $osType ( keys %$operatingSystems ) {
|
| 228 |
print "Checking if OS is $osType in $osString\n" if $verbose > 2;
|
231 |
print "Checking if OS is $osType in $osString\n" if $verbose > 2;
|
| 229 |
next unless $osString =~ m/$osType/i;
|
232 |
next unless $osString =~ m/$$operatingSystems{$osType}{'regex'}/i;
|
| 230 |
print "Yes, it is $osType\n" if $verbose > 2;
|
233 |
print "Yes, it is $osType\n" if $verbose > 2;
|
| 231 |
# We found the OS, set up some defaults
|
234 |
# We found the OS, set up some defaults
|
| 232 |
$os = $osType;
|
235 |
$os = $osType;
|
| 233 |
} # foreach
|
236 |
} # foreach
|
| 234 |
}
|
237 |
}
|