[runit] fixed to not create ${root}sbin/
[opensde-package-nopast.git] / base / serpnp / serpnp.init
blobee279e21bb73dfd73630147687b8c093975e5553
1 #!/bin/bash
3 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
4 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
6 # Filename: package/.../serpnp/serpnp.init
7 # Copyright (C) 2004 - 2006 The T2 SDE Project
9 # More information can be found in the files COPYING and README.
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 # --- SDE-COPYRIGHT-NOTE-END ---
17 # Desc: Serial PNP at bootup
18 # Runlevel: 20 rcX rc3 rc3 rc5
21 main_begin
23 block_begin(start, `Serial PNP probing.')
24 title "Searching for serial mices ..."
25 tmp=$(mktemp)
26 echo -n "Testing "
27 for x in /dev/ttyS* ; do
28 [ -e $x ] || continue
29 echo -n "$x "
30 serpnp $x > $tmp
31 echo -n $(grep -B 1 "CLASS:" $tmp)
32 if grep -q "CLASS: MOUSE" $tmp; then
33 mode=$(grep "CLASS:" $tmp | cut -d' ' -f3)
34 echo "\nStarting: inputattach $mode $x"
35 inputattach $mode $x &
36 echo -n "Testing "
38 done
39 block_end
41 block_begin(stop, `Serial PNP stopping possible inputattach instances.')
42 killall -15 inputattach 2>/dev/null
43 status
44 block_end
46 main_end