Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Created July 5, 2016 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pythoninthegrass/317dc0884d4d6e78109017d8fedec0ac to your computer and use it in GitHub Desktop.
Save pythoninthegrass/317dc0884d4d6e78109017d8fedec0ac to your computer and use it in GitHub Desktop.
#!/bin/bash
# Original: https://jamfnation.jamfsoftware.com/discussion.html?id=14467
# Useful script for deploying printers in a Casper Environment
# Originally by Lwindram on JAMF Nation forums
# https://jamfnation.jamfsoftware.com/viewProfile.html?userID=11026
# Edited to use JSS Script Parameters to make the script portable to all Models. Define $vars in JSS Policy.
# Variables
# PPD = $4 in JSS
ppd=$4
# CUPS Name = $5 in JSS
cupsName=$5
# Display Name = $6 in JSS
humanName=$6
# IP Address and Protocol = $7 in JSS
# Be sure to add the protocol in the paramters!
ip=$7
# Building Location = $8 in JSS
bldg=$8
# Duplex = $9 in JSS
duplex=$9
# Finisher = $10 in JSS
finisher=${10}
# $11
# var=${11}
# Script
lpadmin -p $cupsName -v $ip -D "$humanName" -L "$bldg" -m "$ppd" -E -o printer-is-shared=false -o Duplex="$duplex" -o PageSize=Letter -o Finisher="$finisher"
# man lpadmin
# -p = Named printer or class
# -v = device URI
# -D = textual description of destination
# -L = location of destination
# -m = model (ppd)
# -E (at end) enables device
# CUPS Options
# man lptoptions
# -o printer-is-shared=false disables sharing
# -o Duplex=None disables two-sided printing
# -o Duplex=DuplexNoTumble enables two-sided printing long edge
# -o Duplex=DuplexTumble enables two-sided printing short edge
# Printer has Large Capacity Tray
# lpadmin -p $cupsName -o LargeCapacityTray=Installed
# Finishing options
# Finisher/Finisher:
# NotInstalled
# FinRUBICONB
# FinVOLGABBK
# FinVOLGAB
# FinAMURBK
# FinAMUR = Finisher SR3140
# FinEUPHRATESE
# FinKINGB
# lpadmin -p $cupsName -o Finisher=$finisher
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment