Hi-
Is there a way to run a script as the currently logged in user instead of root? What I want to do is have the software update background check run, do the auto download and then prompt the user that updates are ready for install. I can do this with a script that runs:
cd /System/Library/CoreServices/Software Update.app/Contents/Resources/
./SoftwareUpdateCheck
But, only if you run it as the logged in user. If you run it as root with the agent (or just a sudo on the command line) it's no different than just popping up Software Update and watching it scan for updates. I know it's a minor difference, but I like attention to detail :)
I thought about using sed to pull the current user name from the output of
ls -l /dev/console
And then assigning that to a variable and using sudo -u but I'm not a sed wiz.
Is this the right approach or is there a better way?
---
Jared F. Nichols
Desktop Engineer, Infrastructure and Operations
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436
