happy-dude
05/14/2016, 8:13 PMUse the defaults tool to install your login script. Create the script file and put it in a directory that is accessible to all users. In Terminal, use the following command to install the script (where /path/to/script is the full path to your script file):
sudo defaults write com.apple.loginwindow LoginHook /path/to/script
To remove this hook, delete the property:
sudo defaults delete com.apple.loginwindow LoginHook
Use the same procedure to add or remove a logout hook, but type LogoutHook instead of LoginHook.