#!/pkg/bin/ksh
#--------------------------------------------------------------------
# This is for the viking proto of iMDR
#
# The script restarts the specified processes and sets a marker
# for later use by processes to know that simulated iMDR is in progress.
#
# Copyright (c) 2009-2010 by cisco Systems, Inc.
# All rights reserved.
#--------------------------------------------------------------------

set_imdr_marker()
{
   echo dummy > /tmp/vkg_imdr_restart
}

#
# Arguments: signal, process name
#
restart_process()
{
    PID=`pidin -faN | grep $2 | cut -d ' ' -f 3`
    if [ -n "$PID" ]; then
       echo "Restarting $2 with pid $PID"
       kill -s $1 $PID
    else
       echo "$2 not found"
    fi
}

set_imdr_marker
restart_process 15 prm_server_ty

