Last active
August 29, 2015 14:15
-
-
Save garrett/7952f9eb56ea837b9b00 to your computer and use it in GitHub Desktop.
discover local jetdirect printer IP addresses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# A short script to discover HP JetDirect-enabled printers on your local network | |
# | |
# Requires: nmap, route, awk, grep | |
# | |
# On Fedora/RHEL/CentOS, you can install dependencies with: | |
# sudo yum install -y nmap net-tools curl gawk | |
# | |
# (Most of these commands will most likely be already installed.) | |
nmap --open -n -p 9100 `route | grep default | awk -e '{print $2}'`/24 | grep "scan report" | awk -e '{print $5}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use this on Fedora/RHEL/CentOS, you'll want to make sure dependencies are installed, by running a command like so:
You most likely will have many of the commands already installed, except for nmap.
Other distributions should do something kinda similar, but with whatever applicable package management system (such as
apt-get
,pacman
,brew
, etc.).