Mac – Bash – Attach-Use-Detach DMG

email me

#!/bin/bash

PRODUCTNAME="Product_Name_ABC"
hdiutil attach "DMG_Name.dmg"
installer -verbose -pkg "/Volumes/$PRODUCTNAME/$PRODUCTNAME.pkg" -target / -allowUntrusted
hdiutil detach "/Volumes/$PRODUCTNAME"

 

tags: MrNetTek