File: rc.etc-setserial

package info (click to toggle)
setserial 2.17-43
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 536 kB
  • ctags: 192
  • sloc: sh: 3,100; ansic: 1,008; makefile: 126; csh: 2
file content (67 lines) | stat: -rw-r--r-- 1,346 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#! /bin/sh
#
# This file uses settings from /etc/serial.conf to configure the serial devices.
# This file only exists if you chose to configure the serial devices
# by hand yourself. Otherwise serial configuration happens later on
# using the /etc/init.d/setserial file.
#

SETSERIAL=/bin/setserial

# If the serial executable has been removed abort the configuration
[ -x ${SETSERIAL} ] || exit 0

#
# Support devfs when it arrives.
#
if /bin/ls /dev/tts 2> /dev/null 1>&2 ; then
	ALLDEVS="/dev/tts/*"
else
	# No devfs - old naming scheme
	ALLDEVS="/dev/ttyS?"
	if /bin/ls /dev/ttyS?? 2> /dev/null 1>&2 ; then
		ALLDEVS="$ALLDEVS /dev/ttyS??"
	fi
fi

#
# Handle System V init conventions...
#
case $1 in
start | restart | force-reload )
	action="start";
	;;
stop)
	action="stop";
	;;
modload)
	action="modload";
	;;
modsave)
	action="modsave";
	;;
*)
	action="start";
esac

#
# Is it Start
#

if test $action  = start ; then

  if test -f /etc/serial.conf ; then
        echo "Loading the saved-state of the serial devices from /etc/serial.conf "
        while read device args
        do
               case "$device" in
                   ""|\#*)
                       continue
                       ;;
               esac
           ${SETSERIAL} -z $device $args
           ${SETSERIAL} -bg $device
        done < /etc/serial.conf
  fi
fi