OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.2 KiB

  1. #!/bin/bash
  2. #
  3. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. #
  6. # T2 SDE: package/.../serpnp/serpnp.init
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. #
  17. # Desc: Serial PNP at bootup
  18. # Runlevel: 20 rcX rc3 rc3 rc5
  19. #
  20. main_begin
  21. block_begin(start, `Serial PNP probing.')
  22. title "Searching for serial mices ..."
  23. tmp=$(mktemp)
  24. echo -n "Testing "
  25. for x in /dev/ttyS* ; do
  26. [ -e $x ] || continue
  27. echo -n "$x "
  28. serpnp $x > $tmp
  29. echo -n $(grep -B 1 "CLASS:" $tmp)
  30. if grep -q "CLASS: MOUSE" $tmp; then
  31. mode=$(grep "CLASS:" $tmp | cut -d' ' -f3)
  32. echo "\nStarting: inputattach $mode $x"
  33. inputattach $mode $x &
  34. echo -n "Testing "
  35. fi
  36. done
  37. block_end
  38. block_begin(stop, `Serial PNP stopping possible inputattach instances.')
  39. killall -15 inputattach 2>/dev/null
  40. status
  41. block_end
  42. main_end