This might be a little longer, but it stop inbound threads first, then outbound. Based on how threads are named. It also does a site clean.
hciconnstatus | grep ib | awk ‘{print “hcicmd -p”,$1,”-c “”,$2,”pstop””}’ > $HCIROOT/data/tempthreads
hciprocstatus | awk ‘{print $1}’|sed ‘/Process/d’ |sed ‘/
/d’ > $HCIROOT/data/processes
cat $HCIROOT/scripts/stop.processes.now $HCIROOT/data/tempthreads > $HCIROOT/data/tempthreads2
cp $HCIROOT/data/tempthreads2 $HCIROOT/scripts/stop.processes.now
echo “sleep 25” >> $HCIROOT/scripts/stop.processes.now
awk ‘{print “hcienginestop -p”,$1}’ $HCIROOT/data/processes >> $HCIROOT/scripts/stop.processes.now
echo “hcisitectl -K -f” >> $HCIROOT/scripts/stop.processes.now
echo “sleep 15” >> $HCIROOT/scripts/stop.processes.now
echo “rm $HCISITEDIR/exec/monitorShmemFile” >> $HCIROOT/scripts/stop.processes.now
echo “rm $HCISITEDIR/exec/databases/vista.taf” >> $HCIROOT/scripts/stop.processes.now
echo “rm $HCISITEDIR/exec/sem_*” >> $HCIROOT/scripts/stop.processes.now
echo “hcimsiutil -R” >> $HCIROOT/scripts/stop.processes.now
echo “hcidbinit -i -f” >> $HCIROOT/scripts/stop.processes.now
echo “keybuild rlog” >> $HCIROOT/scripts/stop.processes.now
echo “dchain rlog” >> $HCIROOT/scripts/stop.processes.now
chmod 744 $HCIROOT/scripts/stop.processes.now
$HCIROOT/scripts/stop.processes.now