MunkiAdmin to run a postinstall bash/AppleScript script

440 views
Skip to first unread message

LifeLearner

unread,
Jun 9, 2015, 7:23:15 PM6/9/15
to munk...@googlegroups.com

I went to an imported package's "Install Scripts" tab and copied and pasted my bash script on the right-hand-side, checking the "Post-install script" box.

But nothing happens when I install the package from the client side.


My script is something like this:


#!/bin/bash

osascript << EOF

blah blah AppleScript code

EOF



Any help would be appreciated.

Thank you!


- Life Learner






Zack Bennis

unread,
Jun 10, 2015, 9:08:47 AM6/10/15
to munk...@googlegroups.com
I had a similar experience with a script that contains Applescript code, as well. It actually ran fine when I ran `managedsoftwareupdate --installonly` from Terminal, but silently failed when using MSC. Have you tested installing it via `managedsoftwareupdate`? I still haven't been able to get it to run via MSC, but it would be good to make some progress on that project.

Gregory Neagle

unread,
Jun 10, 2015, 10:06:28 AM6/10/15
to munk...@googlegroups.com
AppleScript is generally a poor choice for code that will run as root (as Munki does) and especially if it will run when no GUI user is logged in (as when the machine is at the loginwindow).

You _may_ be able to make it work, but any issues you have in doing so are _AppleScript_ issues, not Munki issues.

My recommendation is to find another way to accomplish the task.

-Greg

--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

LifeLearner

unread,
Jun 10, 2015, 6:20:04 PM6/10/15
to munk...@googlegroups.com


Thanks for the information, Zack and Greg!


- Life Learner




Reply all
Reply to author
Forward
0 new messages