If you’re using Munki and you have Macs you want recovery partitions on (they’re on there by default, but you may have accidentally deleted a recovery partition by reformatting the entire drive instead of just the main partition), here’s one way you can approach it.
Thing is—it creates a package, which installs receipts. In most cases, you don’t want to reinstall the recovery partition, because the recovery partition is already there and doesn’t need to be reinstalled. By default for .pkg files, Munki will check for receipts to see if a package is installed. We don’t really need the package installed. We just need to see if there is a recovery partition or not.
Munki actually has several ways to check if a package is “installed,” and one of those is an install check script.
So I just created recovery partition packages for Yosemite and El Capitan, and then gave them this install check script:
# Create a variable to see if a recovery partition exists
testVariable=$(diskutil list | grep “Apple_Boot”)
# If it’s empty, it’s not installed
if [ -z “$testVariable” ]; then
# If it’s not empty, it’s installed