#!/pkg/bin/ksh
# ---------------------------------------------------------------------
# show_tech_protection_notif - PFI-Protect-specific show tech command
#
# December 2010, Robert Wills
#
# Copyright (c) 2010-2013 by cisco Systems, Inc.
# All rights reserved.
#--------------------------------------------------------------------

. /pkg/bin/show_tech_main_fragment


__cardtype="unspecified"

# Parse the arguments to the script.
while [ "$#" -gt "0" ]; do
    case "$1" in
        -t) __cardtype="$2"; shift 2;;
        *)  default_parser_function "$@"; shift $#;;
    esac
done

if [ "$__cardtype" == "unspecified" ]; then
    __cardtype=`node_type`
fi


# ***********************************************************
#  Show commands to be run by the show tech-support commands
# ***********************************************************

#############################################################
# Commands that run on RP and LC nodes

rplc_show_exec[1]='show protection-notif statistics'
rplc_show__ksh[1]='ship_show -c pfi-protect'
rplc_show_exec[2]='show protection-notif trace'
rplc_show__ksh[2]='protect_show_ltrace -A'

# End
rplc_show__ksh[3]=''


#############################################################
# Script

display() {
    print_main_heading "show tech-support protection-notif"
        
    case "$__cardtype" in
    "RP")
        exec_commands rplc_show        
        ;;
    "DRP")
        exec_commands rplc_show        
        ;;
    "LC")
        exec_commands rplc_show
        ;;
    esac

    print_main_heading "show tech-support complete"
}

# Run the appropriate function depending on the node specified and if a
# file is specified write the output to that file. We need to redirect
# stderr to stdout when writing to a file because some of the show
# commands output to stderr instead of stdout
. /pkg/bin/show_tech_file_fragment
