#!/bin/sh

exec >>/tmp/term-state 2>&1

echo

echo "At `date`, ${USER-${LOGNAME-'(unknown user)'}} is logged in on `tty`,"
echo "    which is attached to a ${TERM}-compatible terminal."

if [ -n "$STY" ]; then
    echo "Currently, window ${WINDOW} in the screen session ${STY} is active."
else
    echo 'This is not inside a screen session [or $STY was unset].'
fi

echo
