#!/bin/bash
# /etc/rc.d/init.d/klm_module_check
#
# utility to check if specific KLM module is loaded.
#
# Copyright (c) 2016-2017 by Cisco Systems, Inc.
# All rights reserved.
#

if [ -f /etc/init.d/spirit_log.sh ]; then
    source /etc/init.d/spirit_log.sh
fi

# checkModule will check the klm module if its loaded it will 
# return 1 else it will return 0.
function checkModule() {
MODULE="$1"

if lsmod | grep -wF  "$MODULE" &> /dev/null; then
    platform_log "checkModule:Kernel "$MODULE" is loaded"
    return 1
else
    platform_log "checkModule:Kernel "$MODULE" is not loaded"
    return 0
fi
}

