# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/serpnp/serpnp.init # Copyright (C) 2004 - 2021 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- # # Desc: Serial PNP at bootup # Runlevel: 20 rcX rc3 rc3 rc5 # main_begin block_begin(start, `Serial PNP probing') title "Searching for serial mices ..." tmp=$(mktemp) echo -n "Testing " for x in /dev/ttyS* ; do [ -e $x ] || continue echo -n "$x " serpnp $x > $tmp echo -n $(grep -B 1 "CLASS:" $tmp) if grep -q "CLASS: MOUSE" $tmp; then mode=$(grep "CLASS:" $tmp | cut -d' ' -f3) echo "\nStarting: inputattach $mode $x" inputattach $mode $x & echo -n "Testing " fi done block_end block_begin(stop, `Serial PNP stopping possible inputattach instances') killall inputattach 2>/dev/null status block_end main_end