summaryrefslogtreecommitdiff
path: root/sys-apps/setserial/files/serial-2.17-r4
blob: fca37d67a480e545488a541f3ccd837b474adc15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/sbin/openrc-run
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

start() {
	[ ! -e /etc/serial.conf ] && return 0

	grep -v "^#\|^ \|^$\|^stty" /etc/serial.conf | while read device args
	do
		ebegin "Setting ${device} to $args"
		setserial -b ${device} ${args}
		eend $?
	done
	grep  "^stty" /etc/serial.conf | while read x device args
	do
		ebegin "Setting (stty) ${device} to $args"
		stty -F ${device} ${args}
		eend $?
	done

	return 0
}