forked from jontowles/MacScripts
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathChrome.sh
More file actions
14 lines (13 loc) · 789 Bytes
/
Copy pathChrome.sh
File metadata and controls
14 lines (13 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
# Variables
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
loggedInUserHome=`dscl . -read /Users/$loggedInUser NFSHomeDirectory | awk '{print $NF}'`
tld="*.test.com"
# Google Chrome
# backup current file
/bin/cp "/Users/$loggedInUser/Library/Preferences/com.google.Chrome.plist" "/Users/$loggedInUser/Library/Preferences/com.google.Chrome.plist.backup"
/usr/bin/defaults write /Users/$loggedInUser/Library/Preferences/com.google.Chrome.plist AuthNegotiateDelegateWhitelist $tld
/usr/bin/defaults write /Users/$loggedInUser/Library/Preferences/com.google.Chrome.plist AuthServerWhitelist $tld
/usr/sbin/chown $loggedInUser /Users/$loggedInUser/Library/Preferences/com.google.Chrome.plist
# Respawn cfprefsd to load new preferences
/usr/bin/killall cfprefsd