1#!/bin/sh
2
3# 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
15if [ -e /sys/class/tty/$2 -a -c /dev/$2 ]; then
16	${setsid:-} ${getty} -L $1 $2 $3
17fi
18