blob: c7c413ba41e0edabce6029ab23914705ddf184b5 [file] [log] [blame]
Denys Vlasenkof5c2f722009-11-08 00:55:39 +01001#!/bin/sh
2
3exec >/dev/null
4exec 2>&1
5exec </dev/null
6
7user=root
8baud=38400
9delay=3
10export TERM=linux
11
12tty="/dev/${PWD##*/getty_}"
13
14if ! test -e "$tty"; then
15 exec env - sleep 32000
16fi
17
18sleep "$delay"
19
20chown "$user" "$tty" # - devfs made happy
21
22exec <"$tty" >"$tty" 2>&1
23# using . in order to be able to set env (TERM etc) in cfg
24test -x ./cfg && . ./cfg
25
26exec \
27env - "TERM=$TERM" PATH="$PATH" LOGIN_PRE_SUID_SCRIPT="$PWD/login.sh" \
28softlimit \
29setuidgid "$user" \
30getty "$baud" "$tty" "$TERM"