Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 28, 2010, 06:32 AM   #1
olej
macrumors newbie
 
Join Date: Mar 2009
log-out script

Hi,

Where I should insert log-out script in mac os 10.5 ?

I would like control which time users login to computer and which time log out.

I made login script:

#!/bin/sh
mkdir /Volumes/log
mount_smbfs '//@svbk/LOG$' /Volumes/log
echo "$(date "+%Y-%m-%d, %T"), $(users), LOG-IN" >> /Volumes/log/logmac.rtf
umount /Volumes/log
killall Terminal

and logout script:
#!/bin/sh
mkdir /Volumes/log
mount_smbfs '//@svbk/LOG$' /Volumes/log
echo "$(date "+%Y-%m-%d, %T"), $(users), LOG-OUT" >> /Volumes/log/logmac.rtf
umount /Volumes/log
killall Terminal

but I don't now where I should insert logout script.
may somebody have a better idea to control time login,logout ?

Thx for help!!!
olej is offline   0 Reply With Quote
Old Jul 28, 2010, 10:08 PM   #2
calderone
macrumors 68040
 
calderone's Avatar
 
Join Date: Aug 2009
Location: Seattle
You can do this with hooks.

Code:
defaults write com.apple.loginwindow LoginHook /path/to/script.sh
Code:
defaults write com.apple.loginwindow LogoutHook /path/to/script.sh
This requires elevated rights, so you will need to pop a sudo in front of those.

Done.
__________________
ACSA, ACMT
calderone is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Log Out Script Butler Trumpet Mac Programming 13 Apr 11, 2014 03:43 PM
Create script to log malicious actions Cecil888 Mac Basics and Help 0 Jan 7, 2014 11:33 PM
Apple script batch shell script prramesh Mac Programming 5 Sep 15, 2013 03:35 AM
App Store crashes when I log in or log out echo.park OS X 10.8 Mountain Lion 1 Aug 3, 2012 12:52 PM
first script/autamator script feed back zyr123 Mac Programming 1 Jul 17, 2012 10:00 AM

Forum Jump

All times are GMT -5. The time now is 08:38 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC