Last active
August 29, 2015 13:56
-
-
Save rtrouton/8830790 to your computer and use it in GitHub Desktop.
Script for use with Casper's Self Service when deploying Canon printers. Script checks /Library/Printers/Canon/CUPSPS2/Utilities/Canon CUPS PS Printer Utility.app/Contents/Info.plist for the CFBundleVersion key value. If the value returned is less than the version of the current drivers, the print drivers are installed by a Casper policy before …
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 | |
# Check /Library/Printers/Canon/CUPSPS2/Utilities/Canon CUPS PS Printer Utility.app/Contents/Info.plist | |
# for the CFBundleVersion key value. It should match the version of the installed drivers. | |
installed_driver=$(defaults read "/Library/Printers/Canon/CUPSPS2/Utilities/Canon CUPS PS Printer Utility.app/Contents/Info" CFBundleVersion) | |
# Specify the current driver version | |
# by setting parameter 4 in the script | |
# on the JSS | |
driver_version="$4" | |
if [[ ${installed_driver} > ${driver_version} ]]; then | |
echo "Canon PS $installed_driver Print Drivers installed" | |
fi | |
if [[ ${installed_driver} == ${driver_version} ]]; then | |
echo "Canon PS $driver_version Print Drivers installed" | |
fi | |
if [[ ${installed_driver} < ${driver_version} ]]; then | |
echo "Canon PS $driver_version Print Drivers not installed. Installing Canon PS $driver_version Print Drivers" | |
jamf displayMessage -message "The needed Canon printer drivers have not been detected. Installing Canon PS $driver_version Print Drivers before adding the requested printer." | |
jamf policy -trigger companycanondrivers | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment