#!/usr/bin/perl -w
##########################################################################
# $Id: init,v 1.3 1998/02/23 01:16:56 kirk Exp $
##########################################################################
# $Log: init,v $
# Revision 1.3  1998/02/23 01:16:56  kirk
# Getting ready for a first distribution
#
# Revision 1.2  1998/02/23 00:53:42  kirk
# Finished init and modprobe, and added mountd
#
# Revision 1.1  1998/02/23 00:15:39  kirk
# Finished up 'pam', starting on 'init'
#
##########################################################################

########################################################
# This was written and is maintained by:
#    Kirk Bauer <kirk@kaybee.org>
#
# Please send all comments, suggestions, bug reports,
#    etc, to kirk@kaybee.org.
#
########################################################

#$Detail = $ENV{'LOGWATCH_DEBUG'};

while (defined($ThisLine = <STDIN>)) {
    if ( $ThisLine =~ s/Switching to runlevel: (.)$/$1/ ) {
	# Which runlevel did we change to?
	chomp ($ThisLine);
	$RunLevel{$ThisLine}++;
    }
    else {
	# report any unmatched entries
	push @OtherList,$ThisLine;
    }
}
				 
if ( (keys %RunLevel) or (@OtherList) ) {
	
    print "\n\n ---------------------- Init Begin ------------------------- \n\n";
	
    if (keys %RunLevel) {
	foreach $Level (sort keys %RunLevel) {
	    print "   Switched to runlevel " . $Level . " - " . $RunLevel{$Level} . " Time(s)\n";
	}
    }
    
    if ($#OtherList >= 0) {
	print "\n**Unmatched Entries**\n";
	print @OtherList;
    }

    print "\n\n ---------------------- Init End ------------------------- \n\n";
	
}

exit(0);



