#!/usr/X11R6/bin/wish -f
#########!/usr/bin/tclsh 
#
#   isdnbar - tcl/tk script to view ISDN activities without
#             too much CPU-use :-)
#
#   (c) 1997 F.Kalhammer (f.kalhammer@t-online.de)
#
######################################################################


proc init {} {

  global isdninfo  
  set isdninfo [open /dev/isdninfo "r"]  
}



########################################################
#
#  The main part
#
########################################################

init
set x 1




while {1} {

  gets $isdninfo idmap
  gets $isdninfo chmap
  gets $isdninfo drmap
  gets $isdninfo usage
  gets $isdninfo flags
  gets $isdninfo phone


  if {$x !=$usage} {
    set x $usage
    send isdnbar {
      update
    }
  }
}


