50-serial 549 Bytes
Newer Older
Michael Shigorin's avatar
Michael Shigorin committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh
# setup serial console access

BIN=/sbin/agetty
CFG=/etc/inittab
SEC=/etc/securetty

[ -n "$GLOBAL_TTY_DEV" -a -n "$GLOBAL_TTY_RATE" ] || exit 0
[ -s "$CFG" -a -x "$BIN" ] || exit 0

if ! grep -q "$BIN" "$CFG"; then
	n=0
	for t in $GLOBAL_TTY_DEV; do
14 15
		grep -q "$t" "$SEC" || echo "$t" >>"$SEC"
		echo "T$n:2345:respawn:$BIN -L $t $GLOBAL_TTY_RATE vt100" >>$CFG
Michael Shigorin's avatar
Michael Shigorin committed
16 17 18
		n=$(($n+1))
	done
fi
19

20
for c in /boot/extlinux/extlinux.conf /etc/sysconfig/grub2 /boot/boot.conf; do
21 22 23 24
	if [ -f "$c" ]; then
		sed -i "s/ quiet / /g;s/ quiet'/'/" "$c"
	fi
done