You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ This updated version implements some cool new things:
15
15
* Enables usage of Microsoft Excel to edit the CSV file – **this required switching the separator from comma to semicolon**, you may need to update your files accordingly
16
16
* The order of the csv columns do not have to be preserved, but **keep the names of the 1st row**.
17
17
* Sanity checks for the csv fields
18
+
* Option to setup printers using AirPrint provided PPDs, using [airprint-ppd](https://github.com/wycomco/airprint-ppd)
18
19
* Option to define a path to Munki repo and an optional subdirectory
19
20
* Option to define a separate name for the Munki pkginfo item
20
21
* Besides switching to semicolons as csv separator: **This script should preserve backward compatibility!**
@@ -30,11 +31,14 @@ The script can either take arguments on the command line, or a CSV file containi
30
31
The script will generate a pkginfo file. This pkginfo file is a "nopkg" style, and thus has three separate scripts:
31
32
32
33
* installcheck_script
34
+
* preinstall_script
33
35
* postinstall_script
34
36
* uninstall_script
35
37
36
38
The installcheck_script looks for an existing print queue named PRINTERNAME. If it does not find one, it will exit 0 and trigger an installation request. If it does find one, it will compare all of the options provided (DRIVER, ADDRESS, DISPLAYNAME, LOCATION, and OPTIONS) for differences. If there are any differences, it will trigger an installation request.
37
39
40
+
The preinstall_script is used to retrieve the PPD for the printer on the fly, in case the given printer should be setup using AirPrint. In all other cases, this script will be completely removed.
41
+
38
42
The postinstall_script will attempt to delete the existing print queue named PRINTERNAME first, and then will reinstall the queue with the specified options.
39
43
*Note that it does not check to see if the printer queue is in use at the time, so it is possible that existing print jobs will be cancelled if a user is printing when a Munki reinstall occurs.*
40
44
@@ -47,6 +51,7 @@ A template CSV file is provided to make it easy to generate multiple pkginfos in
47
51
```
48
52
./print_generator.py --csv /path/to/printers.csv
49
53
```
54
+
50
55
*Note: if a CSV file is provided, all other command line arguments – besides the optional `--repo` – are ignored.*
51
56
52
57
The CSV file's columns should be pretty self-explanatory:
@@ -71,39 +76,40 @@ A full description of usage is available with:
Generate a Munki nopkg-style pkginfo for printer installation.
78
82
79
83
optional arguments:
80
84
-h, --help show this help message and exit
81
85
--printername PRINTERNAME
82
86
Name of printer queue. May not contain spaces, tabs, # or /. Required.
83
-
--driver DRIVER Name of driver file in /Library/Printers/PPDs/Contents/Resources/. Can be relative or full path. Required.
87
+
--driver DRIVER Either the name of driver file in /Library/Printers/PPDs/Contents/Resources/ (relative or full path) or \'airprint-ppd\' for
88
+
AirPrint printers. Required.
84
89
--address ADDRESS IP or DNS address of printer. If no protocol is specified, defaults to lpd://. Required.
85
90
--location LOCATION Location name for printer. Optional. Defaults to printername.
86
91
--displayname DISPLAYNAME
87
92
Display name for printer (and Munki pkginfo). Optional. Defaults to printername.
88
93
--desc DESC Description for Munki pkginfo only. Optional.
89
-
--requires REQUIRES Required packages in form of space-delimited 'CanonDriver1 CanonDriver2'. Optional.
94
+
--requires REQUIRES Required packages in form of space-delimited 'CanonDriver1 CanonDriver2'. Be sure to add a reference to airprint-ppd
95
+
to setup your printer via AirPrint.Optional.
90
96
--options [OPTIONS ...]
91
97
Printer options in form of space-delimited 'Option1=Key Option2=Key Option3=Key', etc. Optional.
92
98
--version VERSION Version number of Munki pkginfo. Optional. Defaults to 1.0.
93
99
--icon ICON Specifies an existing icon in the Munki repo to display for the printer in Managed Software Center. Optional.
94
100
--catalogs CATALOGS Space delimited list of Munki catalogs. Defaults to 'testing'. Optional.
95
101
--munkiname MUNKINAME
96
102
Name of Munki item. Defaults to printername. Optional.
97
-
--repo REPO Path to Munki repo. If specified, we will try to write directly to its containing pkgsinfo directory. If not defined, we will write to current working directory. Optional.
98
103
--subdirectory SUBDIRECTORY
99
104
Subdirectory of Munki's pkgsinfo directory. Optional.
105
+
--repo REPO Path to Munki repo. If specified, we will try to write directly to its containing pkgsinfo directory. If not defined, we will write to current working directory. Optional.
100
106
--csv CSV Path to CSV file containing printer info. If CSV is provided, all other options besides '--repo' are ignored.
101
107
```
102
108
103
109
As in the above CSV section, the arguments are all the same:
104
110
105
111
*`--printername`: Name of the print queue. May not contain spaces, tabs, "#" or "/" characters. **Required.**
106
-
*`--driver`: Name of the driver file in /Library/Printers/PPDs/Contents/Resources/. This can be either a relative path (i.e. the filename in the path above), or a full path (starting with "/Library"). **Required.**
112
+
*`--driver`: Either the name of driver file in /Library/Printers/PPDs/Contents/Resources/ (relative or full path) or \'airprint-ppd\' for AirPrint printers. **Required.**
107
113
*`--address`: The IP or DNS address of the printer. If no protocol is specified, `lpd://ADDRESS` will be used. **Required.**
108
114
*`--location`: The "location" of the printer. If not provided, this will default to the value of `--printername`.
109
115
*`--displayname`: The visual name that shows up in the Printers & Scanners pane of the System Preferences, and in the print dialogue boxes. Also used in the Munki pkginfo. If not provided, this will default to the value of `--printername`.
@@ -114,8 +120,8 @@ As in the above CSV section, the arguments are all the same:
114
120
*`--icon`: Used only in the Munki pkginfo. If not provided, will default to an empty string ("").
115
121
*`--catalogs`: Space delimited list of Munki catalogs. Defaults to 'testing'. Optional.
116
122
*`--munkiname`: Name of Munki item. Defaults to printername. Optional.
117
-
*`--repo`: Path to Munki repo. If specified, we will try to write directly to its containing pkgsinfo directory. If not defined, we will write to current working directory. Optional.
118
123
*`--subdirectory`: Subdirectory of Munki's pkgsinfo directory. Optional.
124
+
*`--repo`: Path to Munki repo. If specified, we will try to write directly to its containing pkgsinfo directory. If not defined, we will write to current working directory. Optional.
0 commit comments