Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Display a random fortune in the login window' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Display a random fortune in the login window
Authored by: harywilke on Dec 13, '04 10:36:52AM
I'm having a hard time with this hint. it _seems_ simple enough, but alas i'm frustrated. I can get the fortune to update manualy by running the loginfortune.sh script, but i can't get it update with LoginHook or LogoutHook here is what i've done. I'm setting this up under my administrator account. I created the "loginfortune.sh" script as such:

#!/bin/sh
/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText -string "$(/usr/bin/fortune)"
I placed it in /Library/Hooks folder, did a +x chmod on it. Then wrote to LoginHook with

/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow LoginHook /Library/Hooks/loginfortune.sh
I've checked that all is well with the com.apple.loginwindow.plist by opening it with the Property List Editor. sure enough the fortune string is listed and the LoginHook is set to a string value of "/Library/Hooks/loginfortune.sh" so everything looks ok. but it dosen't work. everytime i login i get the same fortune. I think it's a permissions thing because every time i login and try to examin the com.apple.loginwindow.plist i notice that the permissions get set to Owner:system w/ Read&Write Group:Admin w/ Read Only and Others w/ Read Only If i manually run my loginfortune.sh script the Owner switches to my login name w/Read&Write and the fortune gets updated. how can i fix this so it works?

[ Reply to This | # ]