Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dilig0

macrumors newbie
Original poster
Sep 11, 2010
1
0
I need to use hdiutil create command line to create .dmg within a script.
A popup asks me to enter my password.

I would like to skip this step which breaks the execution of the script and automation of the dmg generation.

How to skip the password prompting or pre-enter my password so that the script can execute without any action from any user.

Thanks
 
I need to use hdiutil create command line to create .dmg within a script.
A popup asks me to enter my password.

I would like to skip this step which breaks the execution of the script and automation of the dmg generation.

How to skip the password prompting or pre-enter my password so that the script can execute without any action from any user.

As per the man page... we use the -stdinpass option, and pipe the text string into the command itself:

printf '
passwordGoesHere' |hdiutil create -encryption -stdinpass <other options> nameOfImage.dmg

 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.