Bash script checking if specific Canon printer is online

Objective: Create a bash script that checks if a certain Canon printer is connected and online (connected: true/false)

How can I do this in the terminal (or via python)? I have tried lpstat -p -d but that gives "printer idle" even though it is turned off.

It is a wifi connected printer, so maybe I could ping it?

1

1 Answer

I tried this command cnijnetprn --search auto and it gave the following output:

network cnijnet:/18-0C-AC-2E-EF-87 "Canon iP7200 series" "Canon-iP7200-series_18-0C-AC-2E-EF-87"

If the printer is not online then I don't get any output.

I think I could use that.

1

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

You Might Also Like