Posted on 11-10-2016 08:36 AM
Is there a way to get terminal to quit after a restart, if it was open prior? We perform OS updates via cache and execute policies remotely. Once the OS update is complete and the computers restart our users see terminal still open, and sometimes get confused and/or scared about what to do with it.
This poses no security threat, but if possible I'd like to have terminal not open back up, (and also have whatever else was open previous to the restart come back as well)
Posted on 11-10-2016 09:16 AM
/Users/<username>/Library/Saved Application State contains an entry for each application. I guess you could loop through that directory on each users account and delete 'com.apple.Terminal.savedState' directory for each user.
Posted on 11-10-2016 09:58 AM
You could have a script like this:
osascript -e 'quit app "terminal"'
Then apply it with a policy on Startup or login.