#!/bin/sh
if test $(id -u) != 0; then
 echo Error: You must be root to run this script!
 exit 1
fi
/etc/init.d/cupsys stop
apt-get -y remove --purge cupsys
while p=$(deborphan --guess-all|grep -v ^vdr);[ "$p" ]; do apt-get remove --yes --purge $p; done
echo "printconf printconf/setup_printers boolean false"|debconf-set-selections
apt-get -y install cups-pdf cupsys-client foomatic-db-engine foomatic-db-hpijs foomatic-filters-ppds foomatic-db-gutenprint cupsys-driver-gutenprint foo2zjs printconf
/etc/init.d/cupsys start
cat <<'EOT'

Hint: A) hplip was not installed for hp printers, but you can run the latest hplip installer
         as USER (will ask for root password later)
         http://hplip.sourceforge.net/downloads.html

      B) printconf can be used to autodetect the connected printer or use
         http://localhost:631 [login as root]

EOT
