login.sh 371 B

123456789101112
  1. #!/bin/sh
  2. ttyname=`tty`
  3. ttybase="${ttyname%%[0123456789]*}" # strip numeric tail
  4. if test "$ttybase" = "/dev/tty"; then
  5. tail="${ttyname:8}"
  6. echo "* Setting terminal device's owner to $LOGIN_UID:$LOGIN_GID"
  7. chown "$LOGIN_UID:$LOGIN_GID" "/dev/vcs$tail" "/dev/vcsa$tail"
  8. fi
  9. # We can do this also, but login does it itself
  10. # chown "$LOGIN_UID:$LOGIN_GID" "$ttyname"