#!/bin/sh
# What a virtual terminal runs: take the terminal back from whoever had it, and
# ask for a login. login hands the terminal to the user it lets in, and this
# runs again when their shell exits.
t=$(tty 2>/dev/null)
if [ -n "$t" ]; then
    chown root:tty "$t" 2>/dev/null
    chmod 0660 "$t" 2>/dev/null
fi
exec /bin/login
