Created
August 21, 2012 20:32
-
-
Save nfreader/3419176 to your computer and use it in GitHub Desktop.
Gets status of toner cartridges in an HP LaserJet 2600n
This file contains 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/bash | |
PRINTER = 192.168.1.65; | |
curl http://192.168.1.65/SSI/supply_status_info.htm | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' > /tmp/printer; | |
BLACK=`grep -A 1 "Black Print Cartridge" /tmp/printer | grep %` | |
echo Black: $BLACK; | |
YELLOW=`grep -A 1 "Yellow Print Cartridge" /tmp/printer | grep %` | |
echo Yellow: $YELLOW; | |
CYAN=`grep -A 1 "Cyan Print Cartridge" /tmp/printer | grep %` | |
echo Cyan: $CYAN; | |
MAGENTA=`grep -A 1 "Magenta Print Cartridge" /tmp/printer | grep %` | |
echo Magenta: $MAGENTA; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment