Mon 26 Feb 2007
Adding and Configuring Printers from the Command Line (Shell)
Posted by lee under Linux , Networking , PrintingMy first attempt at adding and configuring printers from the command line in Linux. Posting script and references here.
#!/bin/bash ######################################################################## # # Author: Lee Patton, 2007 # This script adds Wright State printers. To get drivers see: # http://openprinting.org/printer_list.cgi # ######################################################################## ###################################### # Common Printers in Russ ###################################### NAME="Russ1" DESC="Lexmark Full-Duplex B/W" LOC="1st Floor RC" PPD="Lexmark-Optra_T616-Postscript.ppd" HOST="valhalla.cs.wright.edu" QUE="russ1" OPS="-o Duplex=DuplexNoTumble" echo Adding Printer: $NAME, $DESC, $LOC lpadmin -p "$NAME" -v "lpd://$HOST/$QUE" -D "$DESC" -L "$LOC" -P "$PPD" -E lpoptions -p $NAME $OPS ###################################### # Lab Printer -- Default ###################################### NAME="HP" DESC="HP Color Laserjet 2550n" LOC="233 RC" PPD="HP_Color_LaserJet_2550.ppd" HOST="hp01" QUE="raw" OPS="-o none" echo Adding Printer: $NAME, $DESC, $LOC lpadmin -p "$NAME" -v "lpd://$HOST/$QUE" -D "$DESC" -L "$LOC" -P "$PPD" -E lpoptions -d $NAME $OPS ###################################### # EOF ######################################
Some really good references


