Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | #!/bin/sh |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 3 | # busybox' getty does this itself, util-linux' agetty needs extra help |
| 4 | getty="/sbin/getty" |
| 5 | case $(readlink -f "${getty}") in |
| 6 | */busybox*) |
| 7 | ;; |
| 8 | *) |
| 9 | if [ -x "/usr/bin/setsid" ] ; then |
| 10 | setsid="/usr/bin/setsid" |
| 11 | fi |
| 12 | ;; |
| 13 | esac |
| 14 | |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 15 | if [ -e /sys/class/tty/$2 -a -c /dev/$2 ]; then |
| 16 | ${setsid:-} ${getty} -L $1 $2 $3 |
| 17 | fi |