#!/bin/sh
#
# $Header: clearToShipDABs 1.3 2006/09/08 16:43:03MDT Ahmed Teirelbar (ateirelbar) dev  $
#
# $ADICCopyright: Copyright 2007 Quantum Corp. $
#
# $Log: clearToShipDABs  $
# Revision 1.3 2006/09/08 16:43:03MDT Ahmed Teirelbar (ateirelbar) 
# Changed to use generic allBladesOp so I can reuse it from cfl.sh
# Revision 1.2 2006/06/30 16:52:16GMT bszmyd 
# Added Support for DAB Integration. Clear all log and config files, initialize blades and shut them down.
# Revision 1.1 2006/06/26 19:11:32GMT bszmyd 
# Initial revision
# Member added to project e:/mks/projects/predator/ccDevModel/Code/Applications/Scalar101/S101SystemBuild/project.pj
#

BMM_COMMAND="/usr/bin/bmmcommands"
DAB_CONFIG_DIR="/etc/adic/"
DAB_LOG_DIR="/var/log/adic"

. /home/embedded/library/allBladesOp

allBladesOp "initializeBox 1248"

printf "Powering down all blades..."
${BMM_COMMAND} -D
printf "done.\n"

printf "Removing DAB config/log files..."
OLD_PATH=`pwd`
for DIR in `find ${DAB_CONFIG_DIR} -name "I*" -type d`; do
    cd ${DIR} 2>/dev/null
    rm -rf config mgmt mt
done
for DIR in `find ${DAB_LOG_DIR} -name "I*" -type d`; do
    cd ${DIR} 2>/dev/null
    rm -rf *
done
cd ${OLD_PATH}
printf "...finished.\n"

rm -f installed
