#!/bin/sh

#################################################################################
#
#   Lynis
# ------------------
#
# Copyright 2007-2008, Michael Boelen (michael@rootkit.nl), The Netherlands
# Web site: http://www.rootkit.nl
#
# Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
# welcome to redistribute it under the terms of the GNU General Public License.
# See LICENSE file for usage of this software.
#
#################################################################################
#
# Memory and processes
#
#################################################################################
#
    InsertSection "Memory and processes"
#
#################################################################################
#


    counttests

    logtext "Test: Searching /proc/meminfo"
    if [ -f /proc/meminfo ]; then
        Display --indent 2 --text "- Checking /proc/meminfo... " --result FOUND --color WHITE
        FIND=`cat /proc/meminfo | grep "^MemTotal" | tr -s ' ' | awk '{ print $2" "$3 }'`
        MEMORY_SIZE=`echo ${FIND} | awk '{ print $1 }'`
        MEMORY_UNITS=`echo ${FIND} | awk '{ print $2 }'`
        logtext "Result: Found ${MEMORY_SIZE} ${MEMORY_UNITS} memory"
        report "memory_size=${MEMORY_SIZE}"
        report "memory_units=${MEMORY_UNITS}"
      else
        Display --indent 2 --text "- Checking /proc/meminfo... " --result "NOT FOUND" --color WHITE
	logtext "Result: /proc/meminfo file not found on this system"
    fi
    logtextbreak



#
#################################################################################
#

    # counttests
    # Ubuntu test: 
    # Test: dead processes
    # who -d

wait_for_keypress

#
#================================================================================
# Lynis - Copyright 2007-2008, Michael Boelen - www.rootkit.nl - The Netherlands
