How to run a script at login on MAC OSX operating system ?
Please note: The creation or modifications of scripts is unsupported by Technical Support. For help with scripting and other customizations of the Authentication Services you may contact our Professional Services Team by contacting your Account Management team, or by emailing http://www.quest.com/professional-services/ directly.
1. Create a directory called loginscripts in /opt/quest
2. Check the permissions on /tmp/ and /var/tmp to make sure they are rwxrwxrwt
3. Marke sure all scripts have read and execute permissions on them
4. All the scripts you will use need to end up in /opt/quest/loginscripts (including the detach.sh script which is attached and any other scripts you will use).
5. Create a GPO Files policy under Unix Settings -> Client Configuration -> Files to put the scripts on the hosts such as the detach script and any other script that needs to run.
6. Create a user policy to run the detach script. All the script will need is something like the following:
#!/bin/sh
DETACH=/opt/quest/loginscripts/detach.sh
if [ -f $DETACH ] ; then
$DETACH
fi
7. For every script the detach script will run, you need to create something like the following:
<SCRIPT>
#!/bin/sh
trap main SIGHUP SIGTERM SIGINT
main()
{
sleep 30
osascript -e 'tell app "System Events" to display dialog "You have now logged in!" buttons "OK"'
exit
}
main
</SCRIPT>
The sleep is to give the script enough time for Finder to startup. 30 seconds should suffice.
You will not need to configure the detach script to run the scripts in that directory. It will automatically run everything in there. But you will need to put them all in one directory somewhere on the system and make sure to trap those various items.
© 2025 One Identity LLC. ALL RIGHTS RESERVED. Termini di utilizzo Privacy Cookie Preference Center