M BUZZ CRAZE NEWS
// news

How to check if a printer is installed?

By Mia Morrison

I use hp-setup

hp-setup -i -a 192.168.X.XXX

To 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.

3

1 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy