Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # Modify Server Shortcuts, ©2013 David Koff
- # script adds a server to the list appearing at Go -> Connect to Server
- # result will appear for all > 500 user accounts.
- # to create your own shortcuts, just change the variables:
- #
- # ServerName = the name of the server you'd like to appear in your list
- # ServerURL = the actual URL to that server
- #
- # reference thanks to Mike and Rich:
- # http://jamfnation.jamfsoftware.com/viewProfile.html?userID=1927
- # http://derflounder.wordpress.com/2013/01/10/updating-server-bookmarks-in-com-apple-sidebarlists-plist/
- #
- # Created: 4.2013
- #----------------------------------------------------------
- # Variables
- #----------------------------------------------------------
- # --- assignments ---
- ServerName="Pubs Illustrations"
- ServerURL="afp://athens-shared-server/Shared/Illustrations"
- # --- executables ---
- Plist="/usr/libexec/PlistBuddy"
- #--- Set Logging
- exec >> "/Library/Logs/Getty Installations.log" 2>&1
- # --- computationals ---
- date=`date "+%A %m/%d/%Y %H:%M"`
- over500=`dscl . list /Users UniqueID | awk '$2 > 500 { print $1 }'`
- #----------------------------------------------------------
- # Timestamp
- #----------------------------------------------------------
- echo " "
- echo "###################################"
- echo "##### $SCRIPTNAME"
- echo "##### `date "+%A %m/%d/%Y %H:%M"`"
- echo "###################################"
- echo "
- # ---------------------------------------------------------------------------
- # Go to every user, back-up file, add new link, fix permissions
- # ---------------------------------------------------------------------------
- for i in $over500
- do
- cd /Users/$i/Library/Preferences
- zip SidebarListsBackup.zip com.apple.sidebarlists.plist
- $Plist com.apple.sidebarlists.plist -c "Add :favoriteservers:CustomListItems:0 dict"
- $Plist com.apple.sidebarlists.plist -c "Add :favoriteservers:CustomListItems:0:Name string ${ServerName}"
- $Plist com.apple.sidebarlists.plist -c "Add :favoriteservers:CustomListItems:0:URL string ${ServerURL}"
- /usr/sbin/chown ${i}:staff /Users/$i/Library/Preferences/com.apple.sidebarlists.plist
- done
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement