I run this script as a nightly cron job on my netboot server so that I always have a current SmartOS platform version to boot. Inspired by Alain O'Dea's article @ http://blog.alainodea.com/en/ipxe-smartos
After a while I've ended up having converted this to a Chef cookbook.