$cmds{'perl'} = $perlCmd;
$cmds{'runlevel'} = $runlevelCmd;
-my $distro = &get_distro();
-
-if ($distro eq 'redhat' or $distro eq 'fedora') {
- ### add chkconfig only if we are runing on a redhat distro
- $cmds{'chkconfig'} = $chkconfigCmd;
-} elsif ($distro eq 'gentoo') {
- ### add rc-update if we are running on a gentoo distro
- $cmds{'rc-update'} = $rcupdateCmd;
-} elsif ($distro eq 'ubuntu') {
- ### add update-rc.d if we are running on an ubuntu distro
- $cmds{'update-rc.d'} = $updatercdCmd;
+### get the OS type
+&get_os() unless $os_type;
+
+if ($os_type == $OS_LINUX) {
+ print "[+] OS: Linux\n";
+} elsif ($os_type == $OS_CYGWIN) {
+ print "[+] OS: Cygwin\n";
+} elsif ($os_type == $OS_DARWIN) {
+ print "[+] OS: Darwin\n";
+} elsif ($os_type == $OS_BSD) {
+ print "[+] OS: BSD\n";
}
-unless (-d $init_dir) {
- if (-d '/etc/rc.d/init.d') {
- $init_dir = '/etc/rc.d/init.d';
- } elsif (-d '/etc/rc.d') { ### for Slackware
- $init_dir = '/etc/rc.d';
- } else {
- die "[*] Cannot find the init script directory, use ",
- "--init-dir <path>" unless $install_test_dir;
+if ($os_type == $OS_LINUX) {
+ $distro = &get_distro();
+
+ if ($distro eq 'redhat' or $distro eq 'fedora') {
+ ### add chkconfig only if we are runing on a redhat distro
+ $cmds{'chkconfig'} = $chkconfigCmd;
+ } elsif ($distro eq 'gentoo') {
+ ### add rc-update if we are running on a gentoo distro
+ $cmds{'rc-update'} = $rcupdateCmd;
+ } elsif ($distro eq 'ubuntu') {
+ ### add update-rc.d if we are running on an ubuntu distro
+ $cmds{'update-rc.d'} = $updatercdCmd;
+ }
+
+ unless (-d $init_dir) {
+ if (-d '/etc/rc.d/init.d') {
+ $init_dir = '/etc/rc.d/init.d';
+ } elsif (-d '/etc/rc.d') { ### for Slackware
+ $init_dir = '/etc/rc.d';
+ } else {
+ die "[*] Cannot find the init script directory, use ",
- "--init-dir <path>";
++ "--init-dir <path>" unless $install_test_dir;
+ }
}
}