]> git.pld-linux.org Git - projects/rc-scripts.git/blob - rc.d/rc.serial
pare zmian
[projects/rc-scripts.git] / rc.d / rc.serial
1 #!/bin/sh
2 #
3 # Author: Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
4 #
5 # Setting serial ports. This will work only if you have setserial package installed.
6 #
7 # Format of /etc/sysconfig/serial:
8 #/dev/ttyS0 uart 16450 port 0x3F8 irq 4
9 #/dev/ttyS1 uart 16450 port 0x2F8 irq 3
10 #/dev/ttyS2 uart 16450 port 0x3E8 irq 4
11 #
12
13 SETSERIAL=/bin/setserial
14
15 [ -f $SETSERIAL ] || exit 0
16
17 . /etc/rc.d/init.d/functions
18
19 ALLDEVS="/dev/ttyS*"
20
21 show "Setting serial ports "; started
22 if test -f /etc/sysconfig/serial ; then 
23         grep -v "^#" < /etc/sysconfig/serial | grep "/dev/" | while read device args; 
24         do
25         ${SETSERIAL} -z $device $args
26         done
27 fi 
28
29 for a in ${ALLDEVS}; do
30         WHAT="`${SETSERIAL} -bg $a`"
31         if (echo $WHAT | grep -q " at "); then
32                         show "`basename \"$WHAT\"`"; ok
33         fi
34 done
35
This page took 0.026573 seconds and 3 git commands to generate.