#!/usr/bin/perl
#
# $Id: logprof 5579 2005-11-02 18:21:35Z jesse $
#
# ----------------------------------------------------------------------
#    PROPRIETARY DATA of IMMUNIX INC.
#    Copyright (c) 2004, IMMUNIX (All rights reserved)
#
#    This document contains trade secret data which is the property
#    of IMMUNIX Inc.  This document is submitted to recipient in
#    confidence. Information contained herein may not be used, copied
#    or disclosed in whole or in part except as permitted by written
#    agreement signed by an officer of IMMUNIX, Inc.
# ----------------------------------------------------------------------

use strict;
use Data::Dumper;
use Getopt::Long;
use Locale::gettext;
use POSIX;

use Immunix::SubDomain;

# force $PATH to be sane
$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";

# initialize the local poo
setlocale(LC_MESSAGES, "");
textdomain("subdomain-utils");

setup_yast();

# options variables
my $help           = '';
my $logmark;
  
GetOptions(
  'file|f=s'    => \$filename,
  'dir|d=s'     => \$profiledir,
  'logmark|m=s' => \$logmark,
  'help|h'      => \$help,
);
  
# tell 'em how to use it...
&usage && exit if $help;

# let's convert it to full path...
$profiledir = get_full_path($profiledir);
  
unless(-d $profiledir) {
  fatal_error "Can't find subdomain profiles in $profiledir.";
}

# read the settings in /etc/logprof.conf
readconfig();

# load all the include files
loadincludes();

do_logprof_pass($logmark);

shutdown_yast();

exit 0;

sub usage {
  UI_Info(sprintf(gettext("usage: \%s [ -d /path/to/profiles ] [ -f /path/to/logfile ] [ -m \"mark in log to start processing after\""), $0));
  exit 0;
}

