blob: 699a1ead1a402a5f50576db4fd23942837185de4 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001#!/bin/sh
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002
Brad Bishop19323692019-04-05 15:28:33 -04003# busybox' getty does this itself, util-linux' agetty needs extra help
4getty="/sbin/getty"
5case $(readlink -f "${getty}") in
6 */busybox*)
7 ;;
8 *)
9 if [ -x "/usr/bin/setsid" ] ; then
10 setsid="/usr/bin/setsid"
11 fi
12 ;;
13esac
14
Andrew Geisslerc926e172021-05-07 16:11:35 -050015if [ -e /sys/class/tty/$2 -a -c /dev/$2 ]; then
16 ${setsid:-} ${getty} -L $1 $2 $3
17fi