blob: bd81d752f0efa3f0e20fa520392072cbf646b030 [file] [log] [blame]
#!/bin/sh
#
# Start/Stop Maple
#
case "$1" in
start)
echo -e "Checking if svk_init.sh calls trx_init.sh\n"
cd /opt/bcm68620
if [ ! -e trx_init.sh ]; then
echo "trx_init.sh not present" && cd - && exit 1
fi
if [ -z "`grep "./bcm_user_appl < trx_init.sh" svk_init.sh`" ]; then
echo "svk_init.sh does not call trx_init.sh" && cd - && exit 1
elif [[ ! -z "`grep "./bcm_user_appl < trx_init.sh" svk_init.sh | grep "^\s*#\s*"`" ]]; then
echo "call to trx_init.sh is commented out in svk_init.sh" && cd - && exit 1
fi
echo -n "Starting MAPLE: "
cd /opt/bcm68620 && ./svk_init.sh --proxy 40000
;;
stop)
echo -n "Stopping Maple: "
pkill -f bcm_user_appl
if [ ! -z "`lsmod | grep -m 1 coop_dba_linux`" ]; then
rmmod coop_dba_linux
fi
if [ ! -z "`lsmod | grep -m 1 bcm_dev_ctrl_linux`" ]; then
rmmod bcm_dev_ctrl_linux
fi
if [ ! -z "`lsmod | grep -m 1 i2c_devs`" ]; then
rmmod i2c_devs.ko
fi
if [ ! -z "`lsmod | grep -m 1 os_linux`" ]; then
rmmod os_linux.ko
fi
if [ ! -z "`lsmod | grep -m 1 ll_pcie`" ]; then
rmmod ll_pcie.ko
fi
if [ -e /dev/maple_dev_ctrl ]; then
rm /dev/maple_dev_ctrl
fi
LOCK_DIR_INIT=/tmp/bcm68620_svk_init
LOCK_DIR_KERNEL_LOG_OWNED=/tmp/bcm68620_kernel_log_owned
rm -fr $LOCK_DIR_INIT
rm -fr $LOCK_DIR_KERNEL_LOG_OWNED
echo "OK"
;;
restart|reload)
"$0" stop
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?