#!/bin/sh

PATH=$PATH:/usr/bin

case "$1" in
suspend)
   if [ "`/usr/sbin/hciconfig`" != "" ]; then
      hcitool dc `hcitool con | grep ACL | sed 's/^.*\([0-9A-F]\{2\}\(:[0-9A-F]\{2\}\)\{5\}\).*$/\1/'`
      hciconfig hci0 down
      killall hciattach > /dev/null 2>&1 
   fi 
;;
resume)
   if [ "`/usr/sbin/hciconfig`" != "" ]; then
      rfcomm bind all
      cardctl eject
      cardctl insert
      hciconfig hci0 up
   fi
esac


