mpanighetti / install-or-defer

A framework for prompting users of Jamf Pro-managed Macs to install Apple software updates.
Apache License 2.0
148 stars 28 forks source link

clean_up function runs if SUS is unavailable #18

Closed christopherdietrich closed 5 years ago

christopherdietrich commented 5 years ago

If the Software Update Server can't be reached during runtime, the clean_up function will run and remove the LD and PLIST, thus resetting the Deferral-times. Not sure what the smartest solution would be, maybe adding a test like this

Catalog=$(python -c 'from Foundation import CFPreferencesCopyAppValue; print CFPreferencesCopyAppValue("CatalogURL", "com.apple.SoftwareUpdate")')

if curl -s --head --request GET "$Catalog" | grep "200 OK" > /dev/null; then
   # Catalog is available, continue with cleanup
else
   # Catalog is unavailable, skip cleanup
fi

to either the clean_up function or even earlier in the process could help.

christopherdietrich commented 5 years ago

19 should fix this

mpanighetti commented 5 years ago

Fixed in #19.