Photosmart 2575

I just got a HP photosmart 2575, which I will probably post more about in due course, but the useful snippet I am contributing today is this. If you want to scan over the network, you can use XSane, so long as you have the hp-makeuri address of the device. BUT, this only works with the IP of the device, not the mDNS name, so this script will lookup the name, and launch xsane with the IP address, provided it can be found.
If you try this with a non-2570 series scanner make sure you correct the xsane url.

#!/bin/sh# Start XSane with the device IP address
HOSTNAME=<NAME>.local
IP=`resolveip $HOSTNAME`
if [ $? -eq 0 ]; then
IP = `echo "$IP" | cut -f 6 -d ' '`
xsane hpaio:/net/Photosmart_2570_series?ip=$IP
else
zenity --error --text="The device could not be found"
fi
This entry was posted in debian, linux, technology. Bookmark the permalink.

Leave a Reply