Skip to content

Commit a40f542

Browse files
committed
Updated README
1 parent 52ca9f8 commit a40f542

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This updated version implements some cool new things:
1515
* 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
1616
* The order of the csv columns do not have to be preserved, but **keep the names of the 1st row**.
1717
* Sanity checks for the csv fields
18+
* Option to setup printers using AirPrint provided PPDs, using [airprint-ppd](https://github.com/wycomco/airprint-ppd)
1819
* Option to define a path to Munki repo and an optional subdirectory
1920
* Option to define a separate name for the Munki pkginfo item
2021
* 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
3031
The script will generate a pkginfo file. This pkginfo file is a "nopkg" style, and thus has three separate scripts:
3132

3233
* installcheck_script
34+
* preinstall_script
3335
* postinstall_script
3436
* uninstall_script
3537

3638
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.
3739

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+
3842
The postinstall_script will attempt to delete the existing print queue named PRINTERNAME first, and then will reinstall the queue with the specified options.
3943
*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.*
4044

@@ -47,6 +51,7 @@ A template CSV file is provided to make it easy to generate multiple pkginfos in
4751
```
4852
./print_generator.py --csv /path/to/printers.csv
4953
```
54+
5055
*Note: if a CSV file is provided, all other command line arguments – besides the optional `--repo` – are ignored.*
5156

5257
The CSV file's columns should be pretty self-explanatory:
@@ -71,39 +76,40 @@ A full description of usage is available with:
7176

7277
```
7378
./print_generator.py -h
74-
usage: print_generator.py [-h] [--printername PRINTERNAME] [--driver DRIVER] [--address ADDRESS] [--location LOCATION] [--displayname DISPLAYNAME] [--desc DESC] [--requires REQUIRES] [--options [OPTIONS ...]] [--version VERSION] [--icon ICON] [--catalogs CATALOGS] [--munkiname MUNKINAME] [--repo REPO]
75-
[--subdirectory SUBDIRECTORY] [--csv CSV]
79+
usage: print_generator.py [-h] [--printername PRINTERNAME] [--driver DRIVER] [--address ADDRESS] [--location LOCATION] [--displayname DISPLAYNAME] [--desc DESC] [--requires REQUIRES] [--options [OPTIONS ...]] [--version VERSION] [--icon ICON] [--catalogs CATALOGS] [--munkiname MUNKINAME] [--repo REPO] [--subdirectory SUBDIRECTORY] [--csv CSV]
7680
7781
Generate a Munki nopkg-style pkginfo for printer installation.
7882
7983
optional arguments:
8084
-h, --help show this help message and exit
8185
--printername PRINTERNAME
8286
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.
8489
--address ADDRESS IP or DNS address of printer. If no protocol is specified, defaults to lpd://. Required.
8590
--location LOCATION Location name for printer. Optional. Defaults to printername.
8691
--displayname DISPLAYNAME
8792
Display name for printer (and Munki pkginfo). Optional. Defaults to printername.
8893
--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.
9096
--options [OPTIONS ...]
9197
Printer options in form of space-delimited 'Option1=Key Option2=Key Option3=Key', etc. Optional.
9298
--version VERSION Version number of Munki pkginfo. Optional. Defaults to 1.0.
9399
--icon ICON Specifies an existing icon in the Munki repo to display for the printer in Managed Software Center. Optional.
94100
--catalogs CATALOGS Space delimited list of Munki catalogs. Defaults to 'testing'. Optional.
95101
--munkiname MUNKINAME
96102
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.
98103
--subdirectory SUBDIRECTORY
99104
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.
100106
--csv CSV Path to CSV file containing printer info. If CSV is provided, all other options besides '--repo' are ignored.
101107
```
102108

103109
As in the above CSV section, the arguments are all the same:
104110

105111
* `--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.**
107113
* `--address`: The IP or DNS address of the printer. If no protocol is specified, `lpd://ADDRESS` will be used. **Required.**
108114
* `--location`: The "location" of the printer. If not provided, this will default to the value of `--printername`.
109115
* `--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:
114120
* `--icon`: Used only in the Munki pkginfo. If not provided, will default to an empty string ("").
115121
* `--catalogs`: Space delimited list of Munki catalogs. Defaults to 'testing'. Optional.
116122
* `--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.
118123
* `--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.
119125

120126
### Figuring out options
121127

0 commit comments

Comments
 (0)