Hello All-
I have a situation where I need every G4 (around 200) on my network to "Do a little housecleaning" upon login. I have been refered to Apple's site and found that LoginHooks will do exactly what I want it to do, with the least intrusion to the user machine. I read up on how to implement these and thought it would be pretty straight forward.
I modified line in the ttys file from:
console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow" vt100 on secure window=/System/Library/CoreServices/WindowServer onoption="/usr/libexec/getty std.9600"
to this:
console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow -LoginHook /Users/admin/Scripts/cleanDT" vt100 on secure window=/System/Library/CoreServices/WindowServer onoption="/usr/libexec/getty std.9600"
where cleanDT is a script that is executable. A very simple one line script to remove a file called errorlog.txt.
Here is the script I used:
#!/bin/zsh
/bin/rm /Applications/DTApps/errorlog.txt
It works great if I'm in the scripts folder and issue ./cleanDT command. Boom the file is gone. But when I modify the line in ttys, upon reboot I get to the login window, enter name and password and the screen flickers abit a goes right back to the login window. Is there something blindingly obvious that I have wrong here.
Thanks for any help!!
John
I have a situation where I need every G4 (around 200) on my network to "Do a little housecleaning" upon login. I have been refered to Apple's site and found that LoginHooks will do exactly what I want it to do, with the least intrusion to the user machine. I read up on how to implement these and thought it would be pretty straight forward.
I modified line in the ttys file from:
console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow" vt100 on secure window=/System/Library/CoreServices/WindowServer onoption="/usr/libexec/getty std.9600"
to this:
console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow -LoginHook /Users/admin/Scripts/cleanDT" vt100 on secure window=/System/Library/CoreServices/WindowServer onoption="/usr/libexec/getty std.9600"
where cleanDT is a script that is executable. A very simple one line script to remove a file called errorlog.txt.
Here is the script I used:
#!/bin/zsh
/bin/rm /Applications/DTApps/errorlog.txt
It works great if I'm in the scripts folder and issue ./cleanDT command. Boom the file is gone. But when I modify the line in ttys, upon reboot I get to the login window, enter name and password and the screen flickers abit a goes right back to the login window. Is there something blindingly obvious that I have wrong here.
Thanks for any help!!
John