How to check if a printer is installed?
By Mia Morrison •
I use hp-setup
hp-setup -i -a 192.168.X.XXXTo install my printer. How do I check if this printer is already installed to not install it twice?
I should check it by command line with a Boolean variable.
31 Answer
My script is
if [[ $(lpstat -t) = *192.168.X.XXX* ]]
then echo "Printer Already installed"
else hp-setup -i -a 192.168.X.XXX
fi