How to perform shell commands on startup / login similar to login scripts on Windows
Posted on 2008-10-22
I thought this would be quite simple...
I have two user accounts on a OS X 10.5 MacPro.
When "User 1" Logs in I would like to copy a system file from a temp folder to /etc/
The command I would use is "sudo cp /users/User1/temp/hosts.normal /etc/hosts"
I can put this into Apple Script and it looks like :
Do shell script "sudo cp /users/User1/temp/hosts.normal /etc/hosts" user name "User1" password "1234" with administrator privileges
Ideally I would like this script to happen when User1 logs on to the MacPro.
Similar to a Login Script in a Windows environment.
I have a slightly different script for when User 2 logs on to the MacPro.
Where can I put this basic shell script command so that it happens at user login phase?