#!/usr/local/bin/bash
if [ `whoami` != root ]
then 
echo "** Error!! "  
echo "Must be root to run this demo!!!!"
elif [ -f driver/combined.o -a -f credentials/policy -a -f credentials/queries -a -f pdp/pdp ] 
then
`ps ax -opid -ocommand | grep "pdp/pdp" | nawk  -F' ' '{print "kill -2 " $1 " ;"}'`  
# > /dev/null 2>&1
pdp/pdp -n -p credentials/policy > /dev/null 2>&1
echo
echo "*****************"
echo 
echo "PDP Killed and Restarted.  You may now compile your kernel."
echo 
echo "Afterwards, run bin/stop_demo to unload the driver."
echo
echo "*****************" 
else
echo "** Error!! "
echo "You must run bin/setup_demo before bin/start_demo!"
fi
