3
0

run 495 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. exec >/dev/null
  3. exec 2>&1
  4. exec </dev/null
  5. user=root
  6. baud=38400
  7. delay=3
  8. export TERM=linux
  9. tty="/dev/${PWD##*/getty_}"
  10. if ! test -e "$tty"; then
  11. exec env - sleep 32000
  12. fi
  13. sleep "$delay"
  14. chown "$user" "$tty" # - devfs made happy
  15. exec <"$tty" >"$tty" 2>&1
  16. # using . in order to be able to set env (TERM etc) in cfg
  17. test -x ./cfg && . ./cfg
  18. exec \
  19. env - "TERM=$TERM" PATH="$PATH" LOGIN_PRE_SUID_SCRIPT="$PWD/login.sh" \
  20. softlimit \
  21. setuidgid "$user" \
  22. getty "$baud" "$tty" "$TERM"