aboutsummaryrefslogtreecommitdiff
path: root/target/linux/ath79/generic/base-files/etc/hotplug.d/tty/10-inittab-add-console
blob: 118430b154da47425b443e580b9df692d9cd42fd (plain)
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
#!/bin/sh

. /lib/functions.sh

inittab_add_console() {
	local console

	case $(board_name) in
	elecom,wab-i1750-ps)
		console="ttyATH1"
		;;
	*)
		return
		;;
	esac

	[ "$DEVNAME" != "$console" ] && \
		return

	# check existing (commented out) entry
	grep -q "^#\{0,1\}${console}::askfirst" "/etc/inittab" && \
		return

	# append entry
	echo -e "\n${console}::askfirst:/usr/libexec/login.sh" \
		>> /etc/inittab
}

[ "${ACTION}" = "add" ] && inittab_add_console