Posted on 10-12-2012 07:36 AM
The image works fine on older generation of mac book pros, however, with new retina macs out of the box with thunderbolt ethernet dongle it joins the domain,but name under sharing is blank, in casper shows up as "localhost" and in AD it joins named "no name". Is there something I'm missing?
Solved! Go to Solution.
Posted on 10-12-2012 08:01 AM
I was having similar problems. I had built a Golden Master OS image that included network locations that I created, with settings like proxy settings. When I would image, these network settings would not transfer to the imaged machine and its proxy settings would be default, out of the box. 10.8 didn't seem to function well in our proxied environment without these settings being set and it resulted in the name getting wiped at reboot, in the same way you described.
I seem to have gotten around it by removing the network pref files from the GM machine (/Library/Preferences/SystemConfiguration/preferences.plist + NetworkInterfaces.plist), and having a post imaging script create my network locations and preferences, including proxy settings. This script will detect any interfaces currently connected and will set settings for them. This helps us move toward thin imaging... and works better for imaging Airs as well as non Airs. Here's the script we're using:
#!/bin/sh #################################################################################################### #################################################################################################### # This creates and configures Network Locations #################################################################################################### #################################################################################################### echo "Creating and Configuring Network Locations" # HARDCODED VALUES ARE SET HERE wired="Ethernet" wireless="Wi-Fi" usb="USB Ethernet" display="Display Ethernet" tbolt="Thunderbolt Ethernet" proxyAddress="our.proxy.address" port="8080" # Detect network interfaces usbAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: USB Ethernet"
displayAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: Display Ethernet"
tboltAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: Thunderbolt Ethernet"
wiredAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: Ethernet"
wifiAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: Wi-Fi"
############################ ############################ # Automatic Settings ######################################### ############################ ############################ echo "Setting Automatic Location Settings" echo "Pausing 20 seconds..." /bin/sleep 20 ############## ## Ethernet ## ############## if [ "$wiredAdapter" != "" ]; then echo "Ethernet found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$wired" on /usr/sbin/networksetup -setv6off "$wired" /usr/sbin/networksetup -setwebproxystate "$wired" off /usr/sbin/networksetup -setftpproxystate "$wired" off /usr/sbin/networksetup -setsecurewebproxystate "$wired" off /usr/sbin/networksetup -setstreamingproxystate "$wired" off /usr/sbin/networksetup -setsocksfirewallproxystate "$wired" off /usr/sbin/networksetup -setgopherproxystate "$wired" off /usr/sbin/networksetup -setproxybypassdomains "$wired" *.local 169.254/16 OUR BYPASS SETTINGS fi ########### ## Wi-Fi ## ########### if [ "$wifiAdapter" != "" ]; then echo "Wi-Fi found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$wireless" on /usr/sbin/networksetup -setv6off "$wireless" /usr/sbin/networksetup -setwebproxystate "$wireless" off /usr/sbin/networksetup -setftpproxystate "$wireless" off /usr/sbin/networksetup -setsecurewebproxystate "$wireless" off /usr/sbin/networksetup -setstreamingproxystate "$wireless" off /usr/sbin/networksetup -setsocksfirewallproxystate "$wireless" off /usr/sbin/networksetup -setgopherproxystate "$wireless" off /usr/sbin/networksetup -setproxybypassdomains "$wireless" *.local 169.254/16 OUR BYPASS SETTINGS fi ################## ## USB Ethernet ## ################## if [ "$usbAdapter" != "" ]; then echo "USB Ethernet found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$usb" on /usr/sbin/networksetup -setv6off "$usb" /usr/sbin/networksetup -setwebproxystate "$usb" off /usr/sbin/networksetup -setftpproxystate "$usb" off /usr/sbin/networksetup -setsecurewebproxystate "$usb" off /usr/sbin/networksetup -setstreamingproxystate "$usb" off /usr/sbin/networksetup -setsocksfirewallproxystate "$usb" off /usr/sbin/networksetup -setgopherproxystate "$usb" off /usr/sbin/networksetup -setproxybypassdomains "$usb" *.local 169.254/16 OUR BYPASS SETTINGS fi ##################### ## Display Adapter ## ##################### if [ "$displayAdapter" != "" ]; then echo "Display Adapter found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$display" on /usr/sbin/networksetup -setv6off "$display" /usr/sbin/networksetup -setwebproxystate "$display" off /usr/sbin/networksetup -setftpproxystate "$display" off /usr/sbin/networksetup -setsecurewebproxystate "$display" off /usr/sbin/networksetup -setstreamingproxystate "$display" off /usr/sbin/networksetup -setsocksfirewallproxystate "$display" off /usr/sbin/networksetup -setgopherproxystate "$display" off /usr/sbin/networksetup -setproxybypassdomains "$display" *.local 169.254/16 OUR BYPASS SETTINGS fi ######################### ## Thunderbolt Adapter ## ######################### if [ "$tboltAdapter" != "" ]; then echo "Thunderbolt adapter found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$tbolt" on /usr/sbin/networksetup -setv6off "$tbolt" /usr/sbin/networksetup -setwebproxystate "$tbolt" off /usr/sbin/networksetup -setftpproxystate "$tbolt" off /usr/sbin/networksetup -setsecurewebproxystate "$tbolt" off /usr/sbin/networksetup -setstreamingproxystate "$tbolt" off /usr/sbin/networksetup -setsocksfirewallproxystate "$tbolt" off /usr/sbin/networksetup -setgopherproxystate "$tbolt" off /usr/sbin/networksetup -setproxybypassdomains "$tbolt" *.local 169.254/16 OUR BYPASS SETTINGS fi ############################ ############################ # IN DISTRICT SETTINGS ######################################### ############################ ############################ echo "Creating 'In District' Location" /usr/sbin/networksetup -createlocation "IN DISTRICT" populate echo "Switching to 'In District' Location" /usr/sbin/networksetup -switchtolocation "IN DISTRICT" echo "Pausing 20 seconds..." /bin/sleep 20 ############## ## Ethernet ## ############## if [ "$wiredAdapter" != "" ]; then echo "Ethernet found, setting proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$wired" off /usr/sbin/networksetup -setv6off "$wired" /usr/sbin/networksetup -setwebproxy "$wired" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$wired" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$wired" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$wired" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$wired" *.local 169.254/16 OUR BYPASS SETTINGS fi ########### ## Wi-Fi ## ########### if [ "$wifiAdapter" != "" ]; then echo "Wi-Fi found, setting proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$wireless" off /usr/sbin/networksetup -setv6off "$wireless" /usr/sbin/networksetup -setwebproxy "$wireless" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$wireless" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$wireless" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$wireless" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$wireless" *.local 169.254/16 OUR BYPASS SETTINGS fi ################## ## USB Ethernet ## ################## if [ "$usbAdapter" != "" ]; then echo "USB Ethernet Adapter found, setting proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$usb" off /usr/sbin/networksetup -setv6off "$usb" /usr/sbin/networksetup -setwebproxy "$usb" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$usb" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$usb" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$usb" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$usb" *.local 169.254/16 OUR BYPASS SETTINGS fi ##################### ## Display Adapter ## ##################### if [ "$displayAdapter" != "" ]; then echo "Display Adapter found, setting proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$display" off /usr/sbin/networksetup -setv6off "$display" /usr/sbin/networksetup -setwebproxy "$display" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$display" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$display" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$display" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$display" *.local 169.254/16 OUR BYPASS SETTINGS fi ######################### ## Thunderbolt Adapter ## ######################### if [ "$tboltAdapter" != "" ]; then echo "Thunderbolt Adapter found, setting proxy..." /usr/sbin/networksetup -setv6off "$tbolt" /usr/sbin/networksetup -setproxyautodiscovery "$tbolt" off /usr/sbin/networksetup -setwebproxy "$tbolt" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$tbolt" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$tbolt" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$tbolt" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$tbolt" *.local 169.254/16 OUR BYPASS SETTINGS fi ############################ ############################ # OUT OF DISTRICT SETTINGS ######################################### ############################ ############################ echo "Creating 'Out of District' Location" /usr/sbin/networksetup -createlocation "OUT OF DISTRICT" populate echo "Switching to 'Out of District' Location" /usr/sbin/networksetup -switchtolocation "OUT OF DISTRICT" echo "Pausing 20 seconds..." /bin/sleep 20 ############## ## Ethernet ## ############## if [ "$wiredAdapter" != "" ]; then echo "Ethernet found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$wired" off /usr/sbin/networksetup -setv6off "$wired" /usr/sbin/networksetup -setwebproxystate "$wired" off /usr/sbin/networksetup -setftpproxystate "$wired" off /usr/sbin/networksetup -setsecurewebproxystate "$wired" off /usr/sbin/networksetup -setstreamingproxystate "$wired" off /usr/sbin/networksetup -setsocksfirewallproxystate "$wired" off /usr/sbin/networksetup -setgopherproxystate "$wired" off /usr/sbin/networksetup -setproxybypassdomains "$wired" *.local 169.254/16 fi ########### ## Wi-Fi ## ########### if [ "$wifiAdapter" != "" ]; then echo "Wi-Fi found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$wireless" off /usr/sbin/networksetup -setv6off "$wireless" /usr/sbin/networksetup -setwebproxystate "$wireless" off /usr/sbin/networksetup -setftpproxystate "$wireless" off /usr/sbin/networksetup -setsecurewebproxystate "$wireless" off /usr/sbin/networksetup -setstreamingproxystate "$wireless" off /usr/sbin/networksetup -setsocksfirewallproxystate "$wireless" off /usr/sbin/networksetup -setgopherproxystate "$wireless" off /usr/sbin/networksetup -setproxybypassdomains "$wireless" *.local 169.254/16 fi ################## ## USB Ethernet ## ################## if [ "$usbAdapter" != "" ]; then echo "USB Ethernet found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$usb" off /usr/sbin/networksetup -setv6off "$usb" /usr/sbin/networksetup -setwebproxystate "$usb" off /usr/sbin/networksetup -setftpproxystate "$usb" off /usr/sbin/networksetup -setsecurewebproxystate "$usb" off /usr/sbin/networksetup -setstreamingproxystate "$usb" off /usr/sbin/networksetup -setsocksfirewallproxystate "$usb" off /usr/sbin/networksetup -setgopherproxystate "$usb" off /usr/sbin/networksetup -setproxybypassdomains "$usb" *.local 169.254/16 fi ##################### ## Display Adapter ## ##################### if [ "$displayAdapter" != "" ]; then echo "Display Adapter found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$display" off /usr/sbin/networksetup -setv6off "$display" /usr/sbin/networksetup -setwebproxystate "$display" off /usr/sbin/networksetup -setftpproxystate "$display" off /usr/sbin/networksetup -setsecurewebproxystate "$display" off /usr/sbin/networksetup -setstreamingproxystate "$display" off /usr/sbin/networksetup -setsocksfirewallproxystate "$display" off /usr/sbin/networksetup -setgopherproxystate "$display" off /usr/sbin/networksetup -setproxybypassdomains "$display" *.local 169.254/16 fi ######################### ## Thunderbolt Adapter ## ######################### if [ "$tboltAdapter" != "" ]; then echo "Thunderbolt adapter found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$tbolt" off /usr/sbin/networksetup -setv6off "$tbolt" /usr/sbin/networksetup -setwebproxystate "$tbolt" off /usr/sbin/networksetup -setftpproxystate "$tbolt" off /usr/sbin/networksetup -setsecurewebproxystate "$tbolt" off /usr/sbin/networksetup -setstreamingproxystate "$tbolt" off /usr/sbin/networksetup -setsocksfirewallproxystate "$tbolt" off /usr/sbin/networksetup -setgopherproxystate "$tbolt" off /usr/sbin/networksetup -setproxybypassdomains "$tbolt" *.local 169.254/16 fi echo "Done configuring locations, switching back to Automatic" echo "Switching back to 'Automatic' Location" /usr/sbin/networksetup -switchtolocation "Automatic" echo "Pausing 20 seconds..." /bin/sleep 20
echo "Done"
Posted on 10-12-2012 08:01 AM
I was having similar problems. I had built a Golden Master OS image that included network locations that I created, with settings like proxy settings. When I would image, these network settings would not transfer to the imaged machine and its proxy settings would be default, out of the box. 10.8 didn't seem to function well in our proxied environment without these settings being set and it resulted in the name getting wiped at reboot, in the same way you described.
I seem to have gotten around it by removing the network pref files from the GM machine (/Library/Preferences/SystemConfiguration/preferences.plist + NetworkInterfaces.plist), and having a post imaging script create my network locations and preferences, including proxy settings. This script will detect any interfaces currently connected and will set settings for them. This helps us move toward thin imaging... and works better for imaging Airs as well as non Airs. Here's the script we're using:
#!/bin/sh #################################################################################################### #################################################################################################### # This creates and configures Network Locations #################################################################################################### #################################################################################################### echo "Creating and Configuring Network Locations" # HARDCODED VALUES ARE SET HERE wired="Ethernet" wireless="Wi-Fi" usb="USB Ethernet" display="Display Ethernet" tbolt="Thunderbolt Ethernet" proxyAddress="our.proxy.address" port="8080" # Detect network interfaces usbAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: USB Ethernet"
displayAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: Display Ethernet"
tboltAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: Thunderbolt Ethernet"
wiredAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: Ethernet"
wifiAdapter=/usr/sbin/networksetup -listallhardwareports | grep "Hardware Port: Wi-Fi"
############################ ############################ # Automatic Settings ######################################### ############################ ############################ echo "Setting Automatic Location Settings" echo "Pausing 20 seconds..." /bin/sleep 20 ############## ## Ethernet ## ############## if [ "$wiredAdapter" != "" ]; then echo "Ethernet found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$wired" on /usr/sbin/networksetup -setv6off "$wired" /usr/sbin/networksetup -setwebproxystate "$wired" off /usr/sbin/networksetup -setftpproxystate "$wired" off /usr/sbin/networksetup -setsecurewebproxystate "$wired" off /usr/sbin/networksetup -setstreamingproxystate "$wired" off /usr/sbin/networksetup -setsocksfirewallproxystate "$wired" off /usr/sbin/networksetup -setgopherproxystate "$wired" off /usr/sbin/networksetup -setproxybypassdomains "$wired" *.local 169.254/16 OUR BYPASS SETTINGS fi ########### ## Wi-Fi ## ########### if [ "$wifiAdapter" != "" ]; then echo "Wi-Fi found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$wireless" on /usr/sbin/networksetup -setv6off "$wireless" /usr/sbin/networksetup -setwebproxystate "$wireless" off /usr/sbin/networksetup -setftpproxystate "$wireless" off /usr/sbin/networksetup -setsecurewebproxystate "$wireless" off /usr/sbin/networksetup -setstreamingproxystate "$wireless" off /usr/sbin/networksetup -setsocksfirewallproxystate "$wireless" off /usr/sbin/networksetup -setgopherproxystate "$wireless" off /usr/sbin/networksetup -setproxybypassdomains "$wireless" *.local 169.254/16 OUR BYPASS SETTINGS fi ################## ## USB Ethernet ## ################## if [ "$usbAdapter" != "" ]; then echo "USB Ethernet found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$usb" on /usr/sbin/networksetup -setv6off "$usb" /usr/sbin/networksetup -setwebproxystate "$usb" off /usr/sbin/networksetup -setftpproxystate "$usb" off /usr/sbin/networksetup -setsecurewebproxystate "$usb" off /usr/sbin/networksetup -setstreamingproxystate "$usb" off /usr/sbin/networksetup -setsocksfirewallproxystate "$usb" off /usr/sbin/networksetup -setgopherproxystate "$usb" off /usr/sbin/networksetup -setproxybypassdomains "$usb" *.local 169.254/16 OUR BYPASS SETTINGS fi ##################### ## Display Adapter ## ##################### if [ "$displayAdapter" != "" ]; then echo "Display Adapter found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$display" on /usr/sbin/networksetup -setv6off "$display" /usr/sbin/networksetup -setwebproxystate "$display" off /usr/sbin/networksetup -setftpproxystate "$display" off /usr/sbin/networksetup -setsecurewebproxystate "$display" off /usr/sbin/networksetup -setstreamingproxystate "$display" off /usr/sbin/networksetup -setsocksfirewallproxystate "$display" off /usr/sbin/networksetup -setgopherproxystate "$display" off /usr/sbin/networksetup -setproxybypassdomains "$display" *.local 169.254/16 OUR BYPASS SETTINGS fi ######################### ## Thunderbolt Adapter ## ######################### if [ "$tboltAdapter" != "" ]; then echo "Thunderbolt adapter found, setting auto proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$tbolt" on /usr/sbin/networksetup -setv6off "$tbolt" /usr/sbin/networksetup -setwebproxystate "$tbolt" off /usr/sbin/networksetup -setftpproxystate "$tbolt" off /usr/sbin/networksetup -setsecurewebproxystate "$tbolt" off /usr/sbin/networksetup -setstreamingproxystate "$tbolt" off /usr/sbin/networksetup -setsocksfirewallproxystate "$tbolt" off /usr/sbin/networksetup -setgopherproxystate "$tbolt" off /usr/sbin/networksetup -setproxybypassdomains "$tbolt" *.local 169.254/16 OUR BYPASS SETTINGS fi ############################ ############################ # IN DISTRICT SETTINGS ######################################### ############################ ############################ echo "Creating 'In District' Location" /usr/sbin/networksetup -createlocation "IN DISTRICT" populate echo "Switching to 'In District' Location" /usr/sbin/networksetup -switchtolocation "IN DISTRICT" echo "Pausing 20 seconds..." /bin/sleep 20 ############## ## Ethernet ## ############## if [ "$wiredAdapter" != "" ]; then echo "Ethernet found, setting proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$wired" off /usr/sbin/networksetup -setv6off "$wired" /usr/sbin/networksetup -setwebproxy "$wired" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$wired" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$wired" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$wired" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$wired" *.local 169.254/16 OUR BYPASS SETTINGS fi ########### ## Wi-Fi ## ########### if [ "$wifiAdapter" != "" ]; then echo "Wi-Fi found, setting proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$wireless" off /usr/sbin/networksetup -setv6off "$wireless" /usr/sbin/networksetup -setwebproxy "$wireless" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$wireless" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$wireless" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$wireless" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$wireless" *.local 169.254/16 OUR BYPASS SETTINGS fi ################## ## USB Ethernet ## ################## if [ "$usbAdapter" != "" ]; then echo "USB Ethernet Adapter found, setting proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$usb" off /usr/sbin/networksetup -setv6off "$usb" /usr/sbin/networksetup -setwebproxy "$usb" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$usb" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$usb" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$usb" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$usb" *.local 169.254/16 OUR BYPASS SETTINGS fi ##################### ## Display Adapter ## ##################### if [ "$displayAdapter" != "" ]; then echo "Display Adapter found, setting proxy..." /usr/sbin/networksetup -setproxyautodiscovery "$display" off /usr/sbin/networksetup -setv6off "$display" /usr/sbin/networksetup -setwebproxy "$display" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$display" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$display" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$display" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$display" *.local 169.254/16 OUR BYPASS SETTINGS fi ######################### ## Thunderbolt Adapter ## ######################### if [ "$tboltAdapter" != "" ]; then echo "Thunderbolt Adapter found, setting proxy..." /usr/sbin/networksetup -setv6off "$tbolt" /usr/sbin/networksetup -setproxyautodiscovery "$tbolt" off /usr/sbin/networksetup -setwebproxy "$tbolt" "$proxyAddress" "$port" /usr/sbin/networksetup -setftpproxy "$tbolt" "$proxyAddress" "$port" /usr/sbin/networksetup -setsecurewebproxy "$tbolt" "$proxyAddress" "$port" /usr/sbin/networksetup -setstreamingproxy "$tbolt" "$proxyAddress" "$port" /usr/sbin/networksetup -setproxybypassdomains "$tbolt" *.local 169.254/16 OUR BYPASS SETTINGS fi ############################ ############################ # OUT OF DISTRICT SETTINGS ######################################### ############################ ############################ echo "Creating 'Out of District' Location" /usr/sbin/networksetup -createlocation "OUT OF DISTRICT" populate echo "Switching to 'Out of District' Location" /usr/sbin/networksetup -switchtolocation "OUT OF DISTRICT" echo "Pausing 20 seconds..." /bin/sleep 20 ############## ## Ethernet ## ############## if [ "$wiredAdapter" != "" ]; then echo "Ethernet found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$wired" off /usr/sbin/networksetup -setv6off "$wired" /usr/sbin/networksetup -setwebproxystate "$wired" off /usr/sbin/networksetup -setftpproxystate "$wired" off /usr/sbin/networksetup -setsecurewebproxystate "$wired" off /usr/sbin/networksetup -setstreamingproxystate "$wired" off /usr/sbin/networksetup -setsocksfirewallproxystate "$wired" off /usr/sbin/networksetup -setgopherproxystate "$wired" off /usr/sbin/networksetup -setproxybypassdomains "$wired" *.local 169.254/16 fi ########### ## Wi-Fi ## ########### if [ "$wifiAdapter" != "" ]; then echo "Wi-Fi found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$wireless" off /usr/sbin/networksetup -setv6off "$wireless" /usr/sbin/networksetup -setwebproxystate "$wireless" off /usr/sbin/networksetup -setftpproxystate "$wireless" off /usr/sbin/networksetup -setsecurewebproxystate "$wireless" off /usr/sbin/networksetup -setstreamingproxystate "$wireless" off /usr/sbin/networksetup -setsocksfirewallproxystate "$wireless" off /usr/sbin/networksetup -setgopherproxystate "$wireless" off /usr/sbin/networksetup -setproxybypassdomains "$wireless" *.local 169.254/16 fi ################## ## USB Ethernet ## ################## if [ "$usbAdapter" != "" ]; then echo "USB Ethernet found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$usb" off /usr/sbin/networksetup -setv6off "$usb" /usr/sbin/networksetup -setwebproxystate "$usb" off /usr/sbin/networksetup -setftpproxystate "$usb" off /usr/sbin/networksetup -setsecurewebproxystate "$usb" off /usr/sbin/networksetup -setstreamingproxystate "$usb" off /usr/sbin/networksetup -setsocksfirewallproxystate "$usb" off /usr/sbin/networksetup -setgopherproxystate "$usb" off /usr/sbin/networksetup -setproxybypassdomains "$usb" *.local 169.254/16 fi ##################### ## Display Adapter ## ##################### if [ "$displayAdapter" != "" ]; then echo "Display Adapter found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$display" off /usr/sbin/networksetup -setv6off "$display" /usr/sbin/networksetup -setwebproxystate "$display" off /usr/sbin/networksetup -setftpproxystate "$display" off /usr/sbin/networksetup -setsecurewebproxystate "$display" off /usr/sbin/networksetup -setstreamingproxystate "$display" off /usr/sbin/networksetup -setsocksfirewallproxystate "$display" off /usr/sbin/networksetup -setgopherproxystate "$display" off /usr/sbin/networksetup -setproxybypassdomains "$display" *.local 169.254/16 fi ######################### ## Thunderbolt Adapter ## ######################### if [ "$tboltAdapter" != "" ]; then echo "Thunderbolt adapter found, setting auto proxy to off..." /usr/sbin/networksetup -setproxyautodiscovery "$tbolt" off /usr/sbin/networksetup -setv6off "$tbolt" /usr/sbin/networksetup -setwebproxystate "$tbolt" off /usr/sbin/networksetup -setftpproxystate "$tbolt" off /usr/sbin/networksetup -setsecurewebproxystate "$tbolt" off /usr/sbin/networksetup -setstreamingproxystate "$tbolt" off /usr/sbin/networksetup -setsocksfirewallproxystate "$tbolt" off /usr/sbin/networksetup -setgopherproxystate "$tbolt" off /usr/sbin/networksetup -setproxybypassdomains "$tbolt" *.local 169.254/16 fi echo "Done configuring locations, switching back to Automatic" echo "Switching back to 'Automatic' Location" /usr/sbin/networksetup -switchtolocation "Automatic" echo "Pausing 20 seconds..." /bin/sleep 20
echo "Done"
Posted on 10-12-2012 10:21 AM
I have had my own script for setting proxy, however deleting those two files definitely did the trick. Thank you for your quick response :)
Posted on 02-14-2013 02:08 PM
How would I set a Proxy PAC file using this script?
Posted on 02-14-2013 02:13 PM
@craig.george, have a look @ http://macmule.com/2011/09/09/how-to-change-the-automatic-proxy-configuration-url-in-system-preferen...
Posted on 02-14-2013 02:43 PM
Yes, I have seen this page and know about the setautoproxyurl command i got it to work, this Script is awesome. I have been trying to figure out how to go about engineering one for a week now. (My Scripting knowledge is basic at most)