Run script at first login

What is the best way to add a script to MDS which will run on first login and only once?

After finishing the MDS deployment I need to run a custom script after login which depends on internet connectivity to install homebrew and perform other customizations.


We are adding that in. I expect it to be in 1.9. You can do it yourself if you know how to create a package with a self-deleting launchagent. Also, let me know if you purchased a support contract. That will help escalate it.


I am looking for this option as well but haven’t been able to find it in version 2.0. Has it been added to MDS yet?


It was added for packages, but not scripts:


I am hopeful that I’ll be adding that in an update to MDS 2. Please file an issue at


I see. I have a shell script that runs perfectly when I run it inside the OS, but will note complete if I try to run it as part of the workflow.

Essentially it runs curl to download a zip file, unzips the file, and then runs an installer from within the unzipped directory.

My hunch is that it is not finding the correct path to the curl file. I can see curl running in the log, but then it looks like it fails when it tries to unzip the file. My curl command is writing to /tmp. and my following commands all reference the /tmp directory. Do need to define my path differently in order for it to run as part of the workflow?


/tmp might be an issue if it is Catalina. I recommend switching to /var since both “/” and /tmp are not aways available or writable.


Thanks for the suggestion. I will give that a try.

EDIT:: Getting closer now. I was able to get the file copied to the /var/tmp directory and unzip it into the same directory. Only issue that I am running up against now is when I go to run the installer from the unzipped directory with the script, I see a “permission denied” result in the install log. Any suggestions on how to get around that. Do I need to to add a CHMOD statement into the script to edit the permissions of the unzipped folder before trying to run the installer?

This is all running after os and package installs, but before any logins. Not sure what user is executing the commands?


EDIT::: Winner Winner Chicken Dinner…The CHMOD on the directory finally got me where I needed to be and the script successfully completed.


1 Like

Awesome! :partying_face: