Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Script to turn softwareupdate off remotely for users



Hey guys, I just wanted to share a shell command I put together to turn softwareupdate auto checking off for individual users of a machine. You can use the commandline softwareupdate command to turn it off for the user you're logged in as, but there doesn't seem to be any easy way to turn auto update checking for other or all users. This command will only do it for a certain user, which in my case, is always the 20th user displayed in Netinfo. (These are freshly imaged teacher macs, but I migrated their home directories from their old install, and along with them came auto checking for updates) Sorry if this is known already, but it came in very handy and was took very long to figure out from scratch. Any improvements are welcome! I sent this out to all my user's sleeping iBooks as a shell command using Casper, though of course ARD 2 will do this now too!
This must be run as root to work automatically:

su `nicl / -list users | awk ' NR == 20 { print $2 }' ` -c 'softwareupdate --schedule off'

>>> nicl / -list users
This part lists all users out of netinfo, and the one that comes out on the 20th line here is the one I want

>>> awk ' NR == 20 { print $2 }
This prints the second word of line 20, which should be just the username that I want, and the backticks (`) return this to the su command

>>> -c 'softwareupdate --schedule off'
This is the rest of the su command, which just executes the command between the quotes instead of starting an interactive shell.

Thanks,
Dan Bowen
Oak Ridge Schools
Oak Ridge, TN


--
This message has been scanned for viruses as well as dangerous and unsolicited content by Oak Ridge Schools' MailScanner.
_______________________________________________
maclabmanager mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/maclabmanager
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.