if [ -z "$TERM_TYPE" ]; then
	case $(readlink /proc/self/fd/0) in
	    /dev/console|/dev/tty[A-Z]*|/dev/sclp*)
		TERM_TYPE=serial
		;;
	    /dev/pts/*)
		TERM_TYPE=pts
		;;
	esac
fi

case "$TERM_TYPE" in
    serial)
	TERM=dumb
	DEBIAN_FRONTEND=text
	;;
    *)
	DEBIAN_FRONTEND=
	;;
esac

export DEBIAN_FRONTEND
export TERM
export TERM_TYPE
