Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Miles.Kelly97

macrumors member
Original poster
Nov 24, 2015
34
0
Tunbridge Wells
Hi guys


I was wondering if you could help me out, I have been reading into creating a log out script that will delete a users Keychain.

I am finding lots stuff saying that login/logout hooks are now deprecated but they are still functional in El Cap.


However my question is in regards the script itself. I was going to create a logout shell script following the advice from this page http://www.amsys.co.uk/2015/02/delete-keychains-logout/?nabe=5737850786545664:0 but I want to make this specific to one user, I don't want the keychains of our normal users to be affected. This script would be attached to our Freelance account. This would save me time in clearing up after freelancers have used our kit.


Any advice/help would be much appreciated

Thanks

Miles K
 
Might it be less hassle to use a guest account for the freelancers?

I have thought about using the Guest User account however I have always thought it is a bit risky if they were to bring some work down onto their desktop and to not save it back to the server, once they have logged out we will lost some business critical work...
 
I see your point.

Maybe you could use rsync to synchronise the guest's desktop folder with a folder in /Users/Shared. You could use a launch agent to schedule it, say every hour or whatever?
 
Can't you use a conditional statement for this like :

Code:
if [ "$USER" == 'freelancer' ]; then
        do your stuff
fi
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.