if [ $# -lt 3 ]; then
  echo "  updatess-eth: update remote SSerial device running on Ethernet FPGA card"
  echo "  Usage: updatess remotecard fpgacard sserialchan "
  echo "  Example 1 ./updatess 7i73 7i80 4 "
  echo "  Example 2 ./updatess 7i84 7i76e 1"
  echo "  Remote SSerial firmware must be installed in /lib/firmware/hm2/sserial"
  echo "  Firmware name is same as used normally by linuxcnc"
  exit
fi  
echo set jumper on  remote device to setup mode
echo cycle remote device power and then hit return
read
lremote="$(echo $1 | tr '[A-Z]' '[a-z]')"
uremote="$(echo $1 | tr '[a-z]' '[A-Z]')"
sed < updategeneric-eth.hal -e s/@REMOTE@/$lremote/ -e s/@REMOTE@/$uremote/ -e s/@CARD@/$2/ -e s/@CHANNEL@/$3/ -e s#@CONFIG@#$config# > updatess.hal
halrun -f updatess.hal
echo set jumper on remote device back to operate mode
echo and cycle remote device power
