mirror of
https://github.com/MLBZ521/MacAdmin.git
synced 2026-02-03 14:03:26 +00:00
v1.4 = Resolved issue caused by large ppd files
+ Large .ppd files caused curl to error with "argument list to long" -- resolved this by reading configuration from stdin instead of as cli arguments
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
###################################################################################################
|
||||
# Script Name: jamf_CreatePrinters.sh
|
||||
# By: Zack Thompson / Created: 3/1/2018
|
||||
# Version: 1.3 / Updated: 3/23/2018 / By: ZT
|
||||
# Version: 1.4 / Updated: 3/23/2018 / By: ZT
|
||||
#
|
||||
# Description: The purpose of this script is to assist Site Admins in creating Printers in Jamf without needing to use the Jamf Admin utility.
|
||||
#
|
||||
@@ -78,7 +78,8 @@ createPrinter() {
|
||||
echo " "
|
||||
|
||||
# POST changes to the JSS.
|
||||
curlReturn="$(/usr/bin/curl "${curlAPI[@]}" POST ${apiPrinters}/0 --data "<printer>
|
||||
curlReturn="$(/usr/bin/curl "${curlAPI[@]}" POST ${apiPrinters}/0 --data @- <<printerConfig
|
||||
<printer>
|
||||
<name>$printerName</name>
|
||||
<category>Printers</category>
|
||||
<uri>${printerIP}</uri>
|
||||
@@ -89,7 +90,8 @@ createPrinter() {
|
||||
<ppd>${printerCUPsName}.ppd</ppd>
|
||||
<ppd_contents>${printerPPDContents}</ppd_contents>
|
||||
<ppd_path>/Library/Printers/PPDs/Contents/Resources/${printerCUPsName}.ppd</ppd_path>
|
||||
</printer>")"
|
||||
</printer>
|
||||
printerConfig)"
|
||||
|
||||
# Get the Exit Code
|
||||
exitCode=$?
|
||||
|
||||
Reference in New Issue
Block a user