#!/bin/bash


NAMEPRINTER='LBP2900'
CNCUPSLBP='CNCUPSLBP2900CAPTK.ppd'
PATH_DEVICE=$(ls /dev/usb | grep lp) 

ccpdadmin -x $NAMEPRINTER && lpadmin -x $NAMEPRINTER

lpadmin -p $NAMEPRINTER -m $CNCUPSLBP -v ccp:localhost:59687 -E
ccpdadmin -p $NAMEPRINTER -o /dev/usb/$PATH_DEVICE

systemctl restart cups.service & systemctl restart ccpd.service

lpadmin -d $NAMEPRINTER
