#
# This defines paths for IRIX apps.
#

##
## $tar and $tar_extract are special.  They are needed for the
## local rscan no matter what OS we're scanning from.
##
## They must conform to the format:
##   $tar{OSNAMEOSVERSION} = 'something';
##  where OSNAME is, for instance, IRIX or SunOS, etc. and 
##  OSVERSION is 4.0.5, 5.4, etc. or 'default', which is a catchall.
## they are accessable as this, but also as just plain
## $tar and $tar_extract when looked for inside scans in a module.
##
$tar{'IRIXdefault'}           = '/bin/tar';
$tar_extract{'IRIXdefault'}   = 'xBf';

## the rest are OK as usual.
$rsh           = '/usr/bsd/rsh';
$tar_create    = 'cBf';
$hostname      = '/usr/bsd/hostname';
$pwd           = '/bin/pwd';
$showmount     = '/etc/showmount';
$find          = '/bin/find';
$remove        = '/bin/rm -rf';
$gzip          = '/usr/local/bin/gzip';
$gzip_extract  = '-cd';


## OS revision number
chop($os{'version'} = `/bin/uname -r`);

## machine shortname
chop($machine = `/bin/uname -n`);

## get the system ID
chop($sysid = `/etc/sysinfo -s`);

## get more uname stuff
chop($_ = `/bin/uname -a`);
@tmp = split(/\s+/, $_);

$os{'version'} = @tmp[2];       ## major OS version
if (substr($tmp[2], 0, 5) eq '4.0.5') {
  $os{'minor'} = substr($tmp[2], 5, 1);  ## A, B, C, D, F, H
  $os{'version'} = '4.0.5';
  }
$os{'patchlevel'} = $tmp[3];  ## OS patch level
$cpu = "$tmp[4] $tmp[5]";     ## CPU type

## get the domainname if they have it
if (-e "/usr/bin/domainname") {
  chop($tmp = `/usr/bin/domainname`);
  if (substr($tmp, 0, 1) ne ".") { $domain = ".$tmp"; }
  else { $domain = $tmp; }
  }

## try to get the domain from the /etc/resolv.conf file if
## we don't know what it is already
if ($domain eq ".") {
  if (-e '/etc/resolv.conf') {
    open(RESOLV, "/etc/resolv.conf");
    while (<RESOLV>) {
      chop;
      if ((split(/\s+/, $_))[0] eq 'domain') {
        $domain = '.' . (split(/\s+/, $_))[1];
        }
      }
    }
  }

## if we still don't know what the domain is, give up
if ($domain eq ".") { $domain = ""; }

## We should always exit successfully
1;
