#!/bin/bash
####################################################################
#
#      File: S41install-emon
#      Name: Charles Lo
#
#      Description:
#      Load EMON KLM
#
# Copyright (c) 2015, 2017-2018, 2020 by cisco Systems, Inc.
# All rights reserved.
#
#####################################################################

. /etc/init.d/mod_ins/module-load-functions

boot_debug "Executing $0 [S41install-emon]"

case $1 in
    start)
        MY_CARD_IDX="$(get_cmdline_card_index)"
        if [ "$card_idx" != 27065 ]; then   #EYRIE_TBD
            #Install EMON, and dependent modules
            insmod /lib/modules/klm_kfsmutils.o
            insmod /lib/modules/klm_emon.o card_index=$MY_CARD_IDX dbg_no_reload=0 debug_enable=0
        fi
    ;;

    stop)
        boot_debug "Stopping klm_emon"
        rmmod klm_emon
    ;;
esac
