p33 355 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. # run picocom
  3. PortList='/dev/USBconsole /dev/ttyUSB2 /dev/ttyUSB1 /dev/ttyUSB0'
  4. SendFile="$(dirname "$0")/SendCountedFile"
  5. #bps=57600
  6. bps=19200
  7. ERROR()
  8. {
  9. echo error: $*
  10. exit 1
  11. }
  12. for port in ${PortList}
  13. do
  14. [ -e "${port}" ] && exec picocom --baud="${bps}" --send-cmd="${SendFile}" "${port}"
  15. done
  16. ERROR cannot find any ports: ${PortList}