#!/pkg/bin/ksh
# -------------------------------------------------
# LWM IPC Debug Script
#
# Dec, 2011, Deepak Wadhwani
# 
#  Copyright (c) 2007-2012, 2014-2015 by cisco Systems, Inc.
#  All rights reserved.
# -------------------------------------------------

pname=$1
pid=$2

target="/dev/shmem/lwm_ipc_script_output_$pname"
echo "******************************************************" >> $target
echo "Spawning SYSDB script to collect connection details for $pname" >> $target
echo "Will run \"sysdb_debug_script $2 $3 from_lwm\" in back ground">> $target
sysdb_debug_script $2 $3 from_lwm &
echo "******************************************************" >> $target
echo "******************************************************" >> $target
echo "This is LWM IPC debug script for process $pname" >> $target
echo "******************************************************" >> $target
echo "Date:">> $target
date >> $target
echo "Executing LWM command: lwm_debug_proc -p all -b" >> $target
echo "----------------------------------------------------" >>$target
lwm_debug_proc -p all -b >> $target
echo "----------------------------------------------------" >>$target
echo >> $target
echo "Executing LWM command lwm_debug_proc -p all -B" >> $target
echo "----------------------------------------------------" >> $target
lwm_debug_proc -p all -B >> $target
echo >> $target
echo "Executing LWM command lwm_debug_proc -p $pid -l 4" >> $target
echo "----------------------------------------------------" >>$target
lwm_debug_proc -p $pid -l 4 >> $target
echo >> $target
echo "******************************************************" >> $target
echo "End of output for $pname" >> $target
echo "******************************************************" >> $target

echo >> $target
echo >> $target
echo >> $target
