#!/bin/sh

# This script puts DOMs into iceboot state from configboot
# or causes a harmless error if in iceboot
# $Id: iceboot,v 1.1 2004/07/20 23:23:00 kaeld Exp $

for d in $(find /proc/driver/domhub -name is-communicating)
do
  if grep -q "is comm" $d; then
      # echo $d
      idfile=${d%is-communicating}id
      cat $idfile
      devfile=`cat $idfile | sed 's/Card \([0-9]\) Pair \([0-9]\) DOM \([AB]\).\+/\/dev\/dhc\1w\2d\3/'`
      echo 'r\r\n' > $devfile
  fi
done
