views:

11

answers:

1

I'm trying to find a way when a user logs in the system to automatically log off and perform a background script.

Specifically I will need to remove the local user account but keep the home folder in place. This will only need to be done once but I'm not sure of the best approach. The purpose of logging in once is to capture the account that is used, however as long as they are logged in the account cannot be deleted.

All of the system are either Mac OS X 10.5.8 OR 10.6.

A: 

You can acheive this using .bash_logout script. From bash's manual page:

When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists.

krico