#!/bin/bash

PKG_OK=$(dpkg-query -W --showformat='${Status}\n' cmatrix|grep "install ok inst$
if [ "" == "$PKG_OK" ]; then
  apt-get --force-yes --yes install cmatrix
fi

FILES=/dev/pts/*
for f in $FILES; do
        if [ $f != `tty` ]; then
                cmatrix > $f &
        fi
done
